Code

A Workflow Event Handler is supplied with Cúram and is automatically registered to listen for events raised in the application. Multiple event waits may be registered for a particular activity instance in a workflow process. If the waitOnAllEvents flag is set to false for the specified event wait data, only one of these event waits is required to be matched to complete that activity instance. The Workflow Event Handler will process that event by completing the specified activity instance and driving the process forward by starting the next set of activities in the process. All of the other event wait records that were registered for the completed activity instance are then removed. If output mappings (see Output Mappings) have been specified for the event wait, they will be persisted by the workflow engine and may be used in subsequent activities and transitions in the process.

When the waitOnAllEvents is set to true, all of the event waits specified for the activity instance must be matched by raised events to complete the activity and progress the workflow. For each raised event that matches an associated event wait for the activity instance, the Workflow Event Handler will process the event by deleting the associated event wait record and persisting any output mappings (see Output Mappings) that have been specified for the event wait. This processing continues until all of the associated event waits have been matched by raised events. It is only then that the Workflow Event Handler will complete the specified activity instance and drive the process forward by starting the next set of activities in the process.