Table Description
Event Wait: An event which must occur before an Activity Instance can be completed.

Only Activity Instances which depend on some other event have an associated Event Wait. These Activity Instances are:

  • manual Activity Instances (Tasks), which wait for some user-generated event; or
  • 'event wait' Activity Instances, which wait for some system-generated event not strictly related to the workflow, e.g. the completion of some deferred or batch-driven application processing.

Automatic Activity Instances do not depend on an event and are automatically marked as completed by the Workflow Engine as soon as they are executed. An automatic Activity Instance has no related Event Wait.

Example

You define a workflow (Process Definition) to allow correspondence to be sent to customers whenever their payment details change. The activities defined in your workflow are:

  • system prints out a letter (automatic); and
  • User puts the letter in an envelope and posts it (manual).

Person John Smith's payment details change due to an increase in rates. This increase raises an event which causes the Workflow Engine to enact your workflow and create a Process Instance.

The system creates and executes the first (automatic) Activity Instance which prints out the letter.

The system transitions to the next activity definition in your workflow and creates the second Activity Instance. Because this Activity Instance is a manual one, when the Workflow Engine executes the Activity Instance, it also creates:

  • a Task which details the work to be done; and
  • an Event Wait which registers the Workflow Engine's 'interest' in the result of the Task.

The Task is assigned to User Ronan Rooney. The Task instructs Ronan to collect the letter from the printer and post it. Ronan performs this work and in the correspondence screen marks the letter as 'sent'. Curam raises a 'correspondence sent' event by calling the 'raise event' function.

The Event Match Engine:

  • receives the event;
  • searches the Event Wait table to identify which Activity Instance(s) are waiting on the event;
  • finds the Event Wait relating to the Activity Instance for the 'User puts the letter in an envelope and posts it' activity in the Process Instance created for John Smith's payment increase;
  • deletes the Event Wait row;
  • creates a Workflow Event Audit row; and
  • instructs the Workflow Engine to continue.

The Workflow Engine marks the Activity Instance as completed and follows the transition out of it.

Technical Notes

The metadata for the activity stored in the Process Definition defines whether an Activity Instance will have an associated Event Wait.

An Activity Instance may wait on multiple events and thus have multiple related Event Wait rows. When any one of these events is raised, the Workflow Engine:

  • removes all Event Wait rows related to the Activity Instance;
  • creates a single Workflow Event Audit row detailing which Event Wait was actually matched to the event; and
  • continues processing the workflow.
Relationship Diagram
Click the diagram to manipulate and zoom. Traverse the diagram using Click-and-Drag motions.
Attributes (6)
AttributeKeyNullableDescriptionDDL Type
eventWaitIDYesNoThe unique identifier of a workflow event wait.SVR_INT64
activityInstanceID  The unique identifier of a workflow activity instance. This is used to allow an event wait to be associated to a specific activity instance in the workflow system. This association then allows the workflow engine to ascertain which activity instance (if any) to complete as a result of an associated event being raised.SVR_INT64
eventClass  The concept of an event class is used to group related event types. For example, an event class of 'Case' describes a set of events related to the status of a 'Case'. The corresponding event types for this event class could be CloseCase, OpenCase, SuspendCase etc.SVR_STRING<100>
eventType  An identifier for an event on the event class. For example, where the business object type is 'Case', the event type might be 'Case_Open' or Case_Closed etc. The two fields uniquely identify the nature of the event.SVR_STRING<100>
eventMatchData  A unique identifier related to the event class for which the event wait is created. The identifier is used by the event handler to find additional information relevant to handling the event. For example, where the business object type specified for an event is equal to 'Case', the event data could be case identifier, i.e. primaryEventData='12345'.SVR_INT64
lastWritten   SVR_DATETIME
Foreign Keys (2)
ChildParent
EventWait.activityInstanceIDActivityInstance.activityInstanceID
EventWait.eventClassEventClass.eventClass
Indices (2)
Index NameAttributes
EventMatchKeyIdxeventClass, eventType, eventMatchData
EvtWtActInstIDIdxactivityInstanceID
Related Pages (9)