Skip to main content

NOTIFY

[attributename := ] NOTIFY( event [, parm ] [, expression ] )

attributenameOptional. The identifier for this action.
eventThe EVENT function, or a case-insensitive string constant naming the event to generate.
parmOptional. A case-insensitive string constant containing the event's parameter.
expressionOptional. 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')

See Also: EVENT, EVENTNAME, EVENTEXTRA, CRON, WHEN, WAIT