Enactment by Raising Events

Events provide a mechanism for loosely-coupled parts of the application to communicate information about state changes in the system. When one module in the application raises an event, one or more other modules receive notification of that event having occurred provided they are registered as listeners for that event.

To make use of this functionality, some events have to be defined, some application code must raise these events, and some event handlers have to be defined and registered as listeners to such events. Developers must write and register event handlers (classes that perform some action when an event is raised) and optionally event filters (logic that determines whether or not to invoke the handler for a given event). The WMS has an event handler that is automatically registered to listen for events associated with workflows.

It is possible to start a process in response to an event being raised. This requires the setup of some configuration data (either through an administration interface or as pre-configured database entries). The configuration specifies the process/processes to start in response to a specific event being raised. Mappings of event data to the enactment data required by the process can also be configured in this way.

Process enactment event configuration is stored on the database and a user interface is supplied to allow the manipulation of this data. As such process enactment created in this way can be enabled, disabled, changed and even removed at runtime. The main drawback of this approach is that since events have a finite amount of information, only process definitions that require such a small amount of enactment data can be enacted in this way.

A Process Enactment Event Handler is supplied with the application and is automatically registered to listen for events raised in the application. Where a process has been configured to be enacted from an event, the data from the event is mapped into the enactment data of the process, and the process is started.

Further details on enacting processes by raising events may be found in the Process Enactment chapter of the Cúram Workflow Reference Guide.