Working with Process Definition Event Handlers

Event handlers and -actions for process definitions are managed in the event handlers pane of the process definition dialog. The event handlers pane is structured to have an overview tree of the event handlers and -actions on the left side and a details pane for the chosen model element on the right side. Refer also to Events for basic informations.

 

Event Handlers Pane
Figure: Structure of the Event Handlers Pane

The overview tree groups handlers by type. In the event handling tree the bind actions and event actions are listed.


Figure: The Overview Tree

Creating Event Handlers

To create an event handler:

  1. Choose an event handler type in the event handlers pane and press the Add button.
  2. Optionally, change the ID and name of the event handler. Please note that IDs containing hyphens, blanks or dots and IDs starting with digits are not supported. The name is used to display the handler in the overview tree.

Creation of an Event Handler
Figure: Creation of an Event Handler

Event handlers must have a name and an ID uniquely identifying them in the scope of the associated process definition. Additionally, event handlers may have some of the following general attributes:

Event Handler Types

The following event handler types are provided for processes:

Timer Event Handlers

For a timer event handler you can derive the moment of timer either as a constant offset or from workflow data. While a modeling-time timer constant can only be of type org.eclipse.stardust.common.Period (specifying an offset to the event binding time), a timeout derived from workflow data may either be of type java.util.Date , long or java.lang.Long (defining an absolute time) or org.eclipse.stardust.common.Period (again specifying an offset to the event binding time). Numeric timer values are considered to be milliseconds since January 1, 1970 0:0 GMT, according to the specification of method getTime() of class java.util.Date.

 

Event Handlers Pane
Figure: Structure of the Event Handlers Pane

Process State Change Event Handlers

For a process state change event handler you can specify the intended source state and target state you want to match against. See also Process Instance States for more details on modeling the different process instance states.

 


Figure: State Change Event Handler Properties

Modifying Event Handlers

Event handlers can be modified by selecting them in the overview tree of the process properties dialog, then editing their properties in the details pane.

Order of event handlers

All engine event handlers are executed in the order specified in the corresponding properties dialog, e.g. the activity properties dialog or the process definition dialog. Event handlers may be reordered by selecting an event handler in the event handlers pane and then moving it by using the Move Up and Move Down buttons.

Deleting Event Handlers

An event handler can be deleted by selecting it in the event handlers pane of the properties dialog and then pressing the Delete button.

Event Actions

The following event actions are available for process definition event handlers depending on the event handler type:

Creating Event Actions

To create an event action for an event handler:

Add Event Action
Figure: Add an Event Action.


Figure: Action Type Choice

Bind actions are created in a similar manner. Click Add Bind Action or Add Unbind Action to add a bind or unbind action. See also Event Binding.

Abort Process Actions

Abort process actions implicitly target the process instance hosting the current activity instance, thus not needing to be configured.

Process Trigger Actions

For trigger process actions you have to select the process to be triggered.

 


Figure: Select Trigger Process

Send Mail Actions

For send mail actions the following properties may be specified:


Figure: Send Mail Action Properties

Recipient

In the Send Mail To section, choose a recipient:

The sender mail address is used from the Mail.Sender property, set in the carnot.properties file.

Mail Subject

In the Mail Subject entry field, you can enter a subject for the mail. The default value of the subject is "Stardust Notification Mail".

Mail Content

In the Runtime Defined Message section, add the email body text in one of the following ways:

Set Data Actions

Set data actions will set values retrieved from the event handler on workflow data similar to data mappings. To do this, every event handler offers a certain set of access points (which may be empty). This way the following properties may be configured:


Figure: Set Data Action of the Process Dialog

Modifying Event Actions

An event action is modified by selecting it in the overview tree and then editing its properties in the details pane.

Bind actions are modified similarly.

Order of event actions

All event actions are executed in the order specified in the model. Event actions may be reordered by selecting an event action in the event handlers pane of the properties dialog and clicking on the Move Up and Move Down button. The same applies to bind actions.

Deleting Event Actions

An event action or bind action is deleted by selecting it in the event handlers pane and pressing the Delete button.