Throwing events to initiate processes

Events can be used for communicating between running processes. For example, you can use events to initiate or terminate a process, or to signal when processes can proceed when they depend on another process to complete a set of operations.

This Quick Start describes how asynchronous events can be thrown in a process for initiating another process.

The process that throws the asynchronous event includes the event throw of an event type. The type of event that should be used is determined by the context of the process. For example, when Workspace 9 users have attached a file to their task, a TaskAttachmentAdded event can be used.

The process that is initiated when the event is thrown includes the event start point of the event type. The following illustration shows a process that throws an event type, and another process that uses the event type as a start point.

A.
Process that includes the event throw.

B.
Process that includes the event start point.

Prerequisites

To throw event types and use them as start points, the following conditions must be met at design time or when the process executes at run time:

  • The event type that you want to use needs to be available on the Events view.

  • The information that you store in the event data set must be available to the process before the event is thrown. When you throw an event, you populate the event data set with information that event receivers and start points filter on.

  • The variables that store event information have their Input property selected. When you use an event start point, you can store received event information in process variables.

The example processes described previously use an asynchronous event type named POCancel.

Configuration

In the Event Correlation example process, the event data of the POCancel event throw is populated with literal values. For example, the /POEventTemplate/Sender item of the event data set is set to the literal value Sender.

Grafik in Originalgröße anzeigen
Event data sent for the event throw.

In the Event Correlation Start Point example process, an event filter is configured for the POCancel start point so that the Event Correlation Start Point process is executed only if the event throw has a value of "Akira Tanaka" for the /POEventTemplate/Sender item.

Grafik in Originalgröße anzeigen
Event filter for the event receive.

Other considerations

When you use events, you first need to decide which event type to use. If an event type does not exist that meets the requirements of your process, you can create a custom event type.

Custom event types require that you create a data schema. You create a data schema using an XML Schema Definition (XSD) file. Optionally, you can include event message data by defining a separate XSD file, which is useful when you want to pass data from one process to another.

The example process diagram uses the event throw as the only step in the process. However, the event throw can occur between a series of operations in the process, according to the requirements of the process.

Also, the example event throw used literal values to populate the event data. However, a more typical implementation uses process data that is gathered at run time as event data. When run-time data is used, more meaningful filters can be configured on the event start point for deciding whether the process executes.