Event Handling Scope Activity

The Event Handling Scope Activity wraps a sequence of Activities similarly to other Sequence Activities, but also may contain a number of Event Driven Activities; which are Sequences headed by an Event Activity¹. If at any time these events are realized during the normal sequence of child Activities, i.e. in the scope of the Event Handling Scope Activity, control will jump to the relevant Event Sequence. Perhaps this in best illustrated with an example.

                  Event Handling Scope Activity

Above we have an Event Handling Scope Activity with just a Delay Activity in its ‘normal’ sequence (left). It also contains an Event Handling Activity (shown right) which consists of a Receive Port Activity (the ‘event activity’) and a Code Activity.

When executed the workflow will idle for the period set in the Delay Activity as normal. However, we are currently in the scope of the Event handler, so if an event (a message received in this example) is ‘heard’ during this period, control will immediately jump to the Event Driven Activity and its following Activities (the Code Activity in this case) will be executed. If an event is not triggered, i.e. a message isn’t received, within the time period of the Delay Activity, execution will never reach the Event Driven Activity, as once out of scope, the event will be ignored.

For more information see Workflow Basics – Event Handling.

¹Event activity –an activity that triggers an event. A Receive Port Activity, Receive Send Port Response Activity, or Delay activity.