[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 | Optional. A case-insensitive string constant containing the event's parameter. |
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:
NOTIFY('testevent', 'foobar'); receivedFileEvent(STRING name) := EVENT('ReceivedFile', name); NOTIFY(receivedFileEvent('myfile')); //as a service doMyService := FUNCTION OUTPUT('Did a Service for: ' + 'EVENTNAME=' + EVENTNAME); NOTIFY(EVENT('MyServiceComplete', '<Event><returnTo>FRED</returnTo></Event>'), EVENTEXTRA('returnTo')); RETURN EVENTEXTRA('returnTo'); END; doMyService : WHEN('MyService'); // and a call to the service NOTIFY('MyService', '<Event><returnTo>'+WORKUNIT+'</returnTo>....</Event>'); WAIT('MyServiceComplete'); OUTPUT('WORKUNIT DONE')