[attributename := ] NOTIFY( event [, parm ] [, expression ] )
attributename | Optional. The identifier for this action. |
event | The EVENT function, or a case-insensitive string constant naming the event to generate. |
parm | A case-insensitive string constant containing the event's parameter as either a single asterisk ('*') or an XML string beginning and ending with "Event" tags and user-defined tags within those to contain the specific extra information to pass along with the event. |
expression | Optional. A case-insensitive string constant allowing simple message passing, to restrict the event to a specific workunit. |
The NOTIFY action fires the event so that the WAIT function or WHEN workflow service can proceed with operations they are defined to perform.
The expression parameter allows you to define a service in ECL that is initiated by an event, and only responds to the workunit that initiated it.
Example:
//run this first
doMyService := FUNCTION
O := OUTPUT('Did a Service for: ' + 'EVENTNAME=' + EVENTNAME);
N := NOTIFY(EVENT('MyServiceComplete',
'<Event><returnTo>FRED</returnTo></Event>'),
EVENTEXTRA('returnTo'));
RETURN WHEN(EVENTEXTRA('returnTo'),ORDERED(O,N));
END;
OUTPUT(doMyService) : WHEN('MyService');
Then:
// run this in a separate workunit after the first part above completes:
NOTIFY('MyService',
'<Event><returnTo>'+ WORKUNIT + '</returnTo></Event>');
WAIT('MyServiceComplete');
OUTPUT('WORKUNIT DONE')