Working with Events

Events act as the starting point and ending point of the process. The Business Process Modeling perspective supports two types of events:

This chapter covers the following:

Adding Start Event

In the toolbar, click Create Start Event icon and drop it to swim lanes. By default, start event is created with blank name. You can specify name for the event in the label that gets displayed under the element. Note that you must specify the name for start event. If the name is not specified, an error is displayed at the time of model deployment. For more information, please refer to the section Rules for Connecting Elements of the Working with Sequence Flows chapter.


Figure: Create Start Event

The Business Process Modeling perspective supports following types of events:

Adding End Event

You can add End Event icon from toolbar and flyout menu of activity.

OR

Deleting Events

To delete events, hover the mouse over the event added to the swim lanes and click the Delete icon in the flyout menu.


Figure: Delete Start Event

Using Events Flyout Menu

The event flyout menu is displayed when you hover the mouse in the proximity of the event.


Figure: Start Event - Flyout Menu

Following menu options are available in the Start Event flyout menu.

Menu Icon Menu Option Description
Delete Deletes the event. This icon is available for Start Event and End Event flyout menu.
Gateway Adds a new gateway connection from the Start event.
Activity Adds a new activity connection from the Start event
Connect Adds a Sequence Flow with the event as the first endpoint. You can create only one connection from a start event. If you try to establish more than one connection, a validation message is displayed.

Viewing and Editing Properties of Start Event

General Properties

To view and modify properties of Start Event, perform the following steps:

  1. Select the Start Event in the swim lane. The properties window is displayed at the top right corner of the swim lane.


    Figure: Start Event - General Properties

  2. Specify the properties:

Implementation

This option is available only when you switch to Integrator profile. Using this option, you can specify implementing event to initiate the process.

If you select the None option from the Event Class, then the Manual Trigger option is selected, by default. It means that user intervention is required to start the process. You can also select the Please specify option from the Event Implementation drop-down to set the event as Start Event.

Note - Currently, if a Start Event is added in the model created in web-based modeler then an error is displayed during model deployment. Also, switching the implementation type between Manual Trigger and Start Event may not work.

If you select the Message option from the Event Class, then the following implementing events are displayed.


Figure: Message Event - Implementation

If you select the Timer option from the Event Class, then the following implementing event is displayed.


Figure: Timer Event - Implementation

The events of Message class and Timer class are the Camel events that allows the users to configure Camel routes from a process model using Apache Camel spring DSL. When an event is received a process instance is kicked-off and the data is mapped from the exchange message to the data. A basic solution needs to have at least:

File Event

The file event is used to configure a Camel route that can detect file creation in a specific directory. When a file is created its content is retrieved and mapped accordingly. To configure the file event, specify the following details.

E-mail Event

The email event overlay allows to start a process by receiving an incoming email, and passing all the information contained as input data.

Message Event

The message event is used to configure route to receive JMS messages from a JMS broker. To configure the message event, you need to provide the following details.

Adding Bean

You need to specify following bean details to the context file.

<bean id="jmsFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL">
    <value>tcp://<yourhostname>:<yourportname>/value>
    </property>
</bean>

Downloading ActiveMQ Jars

Based on your JMS server, you need to download the ActiveMQ client jars. If you have RAD setup, then downloaded jars should be copied to ipp-portal/lib folder

Scan Event

Using the Scan event, you can start the process instance via a Scan Tool. You can use the scan event with Manual Trigger in one process definition. It allows process instance to be started manually and via Stardust Scan.

Following parameters are associated with scan event:

  1. Event Implementation - Select Scan Event from the drop-down list
  2. Scanned Document - You can select the scanned document of the same model or other model. The drop-down list displays the defined Document data type of the current model as well as other models. If the Process Supports Attachment option is enabled, then the Process Attachment option would also be displayed in the drop-down list.
  3. Metadata Structure - This field displays the metadata associated with the document, if any. Default Metadata structure is also supported on selecting document data to map scan trigger.


Figure: Scan Event - Implementation

Generic Camel Route Event

Note that to start any Camel event, you need to specify the user credentials through Configuration Variables. When you define any event as Camel event, these variables are created by default. Open the model properties - Configuration Variables tab to view these variables. You need to specify the value of the following configuration variables in the Default Value field:


Figure: Model Property - Configuration Variable - Camel Event

Timer Event

Using the Timer event you can:

You can specify following configuration details for timer event:


Figure: Timer Event - Configuration

It's also possible to create timer events based on a cron expression. To do this, you have to use the Generic Camel Route Event. For example, the following route definition will start a process instance every five minutes starting at 12pm (noon) to 2pm on weekdays.

 <from uri="quartz://myTimerName?cron=0+0/5+12-14+?+*+MON-FRI"/>
 <to uri="ipp:direct"/>

More details about the quartz endpoint could be found here.

Event Error handling

In certain circumstances, the deployment of a process can take some time (few seconds). Thus the camel routes can be started and consume messages from endpoints. For that reason, it's possible to get exeptions such as 'Cannot find process definition' in case events happen (i.e. a new message added to a jms queue). To avoid such exception, the camel context should contain an error handler as below:

<errorHandler useOriginalMessage="true" id="camelErrorHandler"
		 type="TransactionErrorHandler"
		transactionManagerRef="carnotTxManager" xmlns="http://camel.apache.org/schema/spring">
		<redeliveryPolicy maximumRedeliveries="4"
			redeliveryDelay="10000" />
</errorHandler>
<camelContext id="defaultCamelContext" errorHandlerRef="camelErrorHandler"
		trace="true" xmlns="http://camel.apache.org/schema/spring">
</camelContext>

Comments - Start Event

To add comments for events, perform the following steps:

  1. Click the Comments icon displayed at the top right corner of the swim lane


    Figure: Start Event - Comment Icon

  2. Add comment in the text box and click Submit. The newest comment gets displayed at the top of the table.


    Figure: Start Event - Add Comment

  3. To delete the comment, select the comment and click the Delete icon. The user, who has submitted the comment, only that user can delete the comment. If the other user selects the comment or no comment is selected, the Delete icon remains in disabled state.

Viewing and Editing Properties of End Event


Figure: End Event - Properties

Implementation

This option is available only when you switch to Integrator profile. However, note that for the end event implemenation is not yet available.

Comments - End Event

To add comments for events, perform the following steps:

  1. Click the Comments icon displayed at the top right corner of the swim lane


    Figure: Start Event - Comment Icon

  2. Add comment in the text box and click Submit. The newest comment gets displayed at the top of the table.


    Figure: End Event - Comment

  3. To delete the comment, select the comment and click the Delete icon. The user, who has submitted the comment, only that user can delete the comment. If the other user selects the comment or no comment is selected, the Delete icon remains in disabled state.

Working with Intermediate Events

The Web-based modeler supports Intermediate events which follows BPMN 2.0 semantics. Intermediate Events are events that occur after a process has been started. An Intermediate Event affects the flow of the process by showing where messages and delays are expected, distributing the normal flow through exception handling. However, an Intermediate Event does not start or directly terminate a process.

Following sub-types are supported:

You can perform following operations on intermediate events:

Note
Models containing intermediate events may cause inconsistency warnings and errors when opened in the Eclipse-based modeler which may prevent direct deployment from the Eclipse-based modeler.

Adding Intermediate Events

In the toolbar, click Create Intermediate Event icon and drop it to swim lanes. By default, non-boundary Timer event gets created.


Figure: Create Intermediate Event

Adding Boundary Event

To add the boundary event, click the Create Intermediate Event icon and drop it on activity or on the boundary of an activity.


Figure: Add Boundary Event

By default, Timer boundary event gets added. You can also define Error event as boundary event.


Figure: Boundary Event

Note that Boundary events must have an exception flow.

Adding Non-boundary Events

To add the non-boundary event, click the Create Intermediate Event icon and drop it on the diagram canvas between two activities or activity and gateway.


Figure: Non-boundary Event

Note that only Timer event can be added as a non-boundary event. Non-boundary event is always between two activities, or gateway and activity. Non-Boundary Intermediate Events should have one inbound and one outbound sequence flow, otherwise a warning is issued during model deployment.

For non-boundary timer event, the activity goes into Hibernate state till the time period is defined. Once the time period criteria meet, the next activity gets activated by completing a timer for the underline activity.

Dos and Don'ts wrt. Boundary Event Modeling

Following topology rules should be followed when modeling intermediate events in the Web-based modeler:

Using Intermediate Event Flyout Menu

The intermediate event flyout menu is displayed when you hover the mouse in the proximity of the data.


Figure: Intermediate Event - Flyout Menu

Menu Icon Menu Option Description
Connect Adds a Sequence Flow or Exception Flow with the event as the first endpoint
New Activity Adds a new manual activity with sequence flow or exception flow connecting the event to the new activity.
New Gateway Adds a new Gateway(XOR) with sequence flow or exception flow connecting the event to the new gateway.
Delete Deletes the event.

Viewing and Editing Properties

General Properties

Following properties are supported:

Comments

To add comments for events, perform the following steps:

  1. Click the Comments icon displayed at the top right corner of the swim lane


    Figure: Start Event - Comment Icon

  2. Add comment in the text box and click Submit. The newest comment gets displayed at the top of the table.


    Figure: End Event - Comment

  3. To delete the comment, select the comment and click the Delete icon. The user, who has submitted the comment, only that user can delete the comment. If the other user selects the comment or no comment is selected, the Delete icon remains in disabled state.

Timer Event - Implementation

This option is available only when you switch to Integrator profile.

Note that you need to start Event Daemon when working with Timer Event. For more information about event daemon, please refer to the chapter Managing Daemons of the Stardust Portal documentation.


Figure: Timer Event - Implementation

You can specify following implementation properties:

Note that the Automatic Binding option is not supported in the Web-based modeler. However, it is implicitly set to True.

The Consume On Match option is also not supported in the Web-based modeler. However, it is implicitly set to False.

Error Boundary Event - Implementation

This option is available only when you switch to Integrator profile. Note that you need to start Event Daemon when working with Error Event.

The Error Boundary Events may only be Interrupting, meaning when the event is triggered the Activity that it is bound to is aborted and the exception path follows. The following properties are displayed:


Figure: Error Event - Implementation

Note that the Automatic Binding option is not supported in the Web-based modeler. However, it is implicitly set to True.

If there are multiple error boundary events, the exception hierarchies should be disjunct. For example, for Activity 1 two error boundary events are added in order say java.lang.IllegalAccessException and General(java.lang.Exception).


Figure: Multiple Error Boundary Events

Then, in this case warning is displayed at the time of model deployment. Note that you can either specify super class or sub class of the exception. If you specify both then in that case an error is displayed at the time of deployment.


Figure: Multiple Error Event - Deployment Validation

Binding and Unbinding Boundary Events to and from Activities

Binding Boundary Events

To bind boundary events to an activity, they can be dropped onto another activity or the drawing canvas. The existing exception flow, e.g. a connection, is maintained in that case.

When binding an unbound event that has incoming and outgoing connections, the incoming is deleted, whereas the outgoing will be maintained. An exception is thrown when the event is bound to the activity that is attached to the event's outgoing connection. In this case both, the incoming and outgoing connections, are deleted.

Unbinding Boundary Events

Boundary Events can be unbound from activities via drag-and-drop.

Examples

Note
To execute following examples, please start Event Daemon.

Interrupting Timer Boundary Event

In the following example, Timer event is specified for the activity named ProcessActivityInTime. If the user does not complete this activity before the specified time interval, the timer is reached and the exception flow is followed.

  1. Create a model as shown in the following screenshot


    Figure: Timer Boundary Event - Example

    Note that the timer event is Interrupting.


    Figure: Interrupting Timer Event

  2. Now deploy the model and switch to the Workflow Execution perspective.
  3. Activate the process instance
  4. Click the Suspend option
  5. Switch to the Administration perspective and open the Activity Overview panel. Note that the status of the ProcessActivityInTime activity is Aborted and the exception flow activity named TimerExceptionFlow is in Suspended state.


    Figure: Activity Overview

Non-interrupting Timer Boundary Event

Scenario 1

In the following example, the user waits for the specified time interval so that the normal flow is followed.

  1. Create a model as shown in the following screenshot:


    Figure: Timer Boundary Event - Example

    Note that the timer event is non-interrupting.


    Figure: Non-interrupting Timer Event

  2. Now deploy the model and switch to the Workflow Execution perspective.
  3. Activate the activity named SourceActivity and wait for 5 seconds
  4. Check that it is still active
  5. Complete the activity SourceActivity
  6. Check that the activity named NormalFlow is followed
  7. Check the activity status in the Activity Overview panel of the Administration perspective. Note that the activity named ExceptionFlow is in Suspended state.


    Figure: Activity Overview

Scenario 2

In the following scenario, the user completes the activity to which the timer event is bound before the timer is over.

  1. Activate the SourceActivity and complete it before the specified timer is over
  2. Wait for the time out
  3. Verify that boundary event transition is not followed. In the Activity Overview panel it does not display the status of the activity named ExceptionFlow.


    Figure: Activity Overview

Timer Non-boundary Event

In the following example, the user completes the SourceActivity and once the timer is reached, the next activity executes.

  1. Create a model as shown in the following screenshot


    Figure: Timer Non-boundary Event - Example

  2. Specify the timer implementation properties


    Figure: Timer Non-boundary Event - Implementation

  3. Now deploy the model and switch to the Workflow Execution perspective.
  4. Activate the activity named SourceActivity and complete it

    Note that the next activity named TargetActivity is initiated only when the timer is reached.

  5. Open the worklist of the user to activate and complete the next activity.


    Figure: Worklist - Non-boundary Timer Event Activity

Error Boundary Event

In the following example, the user completes the activity named FirstActivity. Then, the application activity MessageTransformation is executed. If the general exception is thrown then the exception flow is followed.

  1. Create a model as shown in the following screenshot


    Figure: Error Boundary Event - Example

  2. Specify the error event implementation properties


    Figure: Error Boundary Event - Implementation

  3. Now deploy the model and switch to the Workflow Execution perspective.
  4. Activate the activity named FirstActivity and complete it. Note that the ErrorFlow activity is followed.
  5. Switch to the Administration perspective and open the Activity Overview panel. Note that the MessageTransformation activity is in Aborted state.


    Figure: Activity Overview