Schedule Task's Triggered BPMs

The closest to the solution I've come is to create a pre-process bpm in this location: SysMonitor.UpdateSysMonitorSched

The bpm has the following content:

for each ttSysAgentTask where ttSysAgentTask.RowMod='U' OR ttSysAgentTask.RowMod='A' no-lock , each SysAgentSched where (ttSysAgentTask.AgentID = SysAgentSched.AgentID and ttSysAgentTask.AgentSchedNum = SysAgentSched.AgentSchedNum) no-lock.

{lib/PublishInfoMsg.i &InfoMsg = "'My debug message.'"  &InfoSeverity = {&MESSAGE_INFO}}.

end.


But I can't just get the bpm to be triggered when I create a new schedule task which shows up in the System Monitor.

Hello All:

 

I need to send out an email whenever there is a new schedule task in the vantage System Monitor. How do I trigger a BPM code when there is a new schedule task?

 

For example, when I need to send out an email every time the Demand Entry window is updated I use the code below.

 

Here are the locations of a few of the things I mentioned earlier. In case if helps:

 

Demand Entry Location: Sales Mgt > Demand Mgt > General Operations > Demand Entry

 

BPM Location: System Mgt

> Business Process Mgt > Setup > Method Directives > DemandEntry.Update > Post-Processing > New-Demand-Email

 

- CODE -

 

define variable SendMsg_from as character no-undo initial '':U.

define variable SendMsg_to as character no-undo initial '':U.

define variable SendMsg_cc as character no-undo initial '':U.

define variable SendMsg_subject as character no-undo initial '':U.

define variable SendMsg_body as character no-undo initial '':U.

define variable SendMsg_hEmailProc as handle no-undo.

define Variable ExpDate as character no-undo initial '':U.

define Variable User1 as Character.

run Bpm/BpmEmail.p persistent set SendMsg_hEmailProc.          

 

 

Define variable Comments as character no-undo initial ' ':U.

DEFINE variable flag AS INTEGER.

 

ASSIGN flag = 0.

 

For Each Company no-lock.                                                                         

assign SendMsg_from = 'edi@...'.

assign SendMsg_to = 'staff1@...; staff2@...;'.

End.

 

assign SendMsg_CC = SendMsg_CC + 'staff3@...'.                                                                        

assign SendMsg_subject = SendMsg_subject + 'New EDI Demand Order'.

 

 

for first ttdemandhead where ttdemandhead.ReadyToProcess = True:

                assign SendMsg_body = 

                'Customer: ' + ttdemandhead.CustomerNameDummy + CHR(10) + CHR(10) +

                'PO Number: ' + string(ttdemandhead.POrderNumberDummy) + CHR(10).

                assign flag = 1.

end.

 

 

if(flag = 1) and ttdemandhead.CustomerNameDummy <> ' ' then do.

run SendEmail in SendMsg_hEmailProc (

true,

CUR-COMP,

SendMsg_from,

SendMsg_to,

SendMsg_cc,

SendMsg_subject,

SendMsg_body,

"":U

).

end.

if valid-handle(SendMsg_hEmailProc) then delete procedure SendMsg_hEmailProc.

leave.

 

- END OF CODE –

 

Additional Details:

 

I’m running –

 

Vantage 8.03.409C

Released:
6/13/2010