Working with Events

This chapter covers the following:

Viewing and Editing Properties of a Start Event

General 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.

The events of Message class and Timer class are the Camel events that allow 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 one process model.

Message Events

Working with a 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.

Configuring a File Event

Using Parameters Tab

Using Split Tab

Using this tab, users can specify how the file content is splitted.

Using Converter Tab

Use this tab to specify how the file content is converted. Select the Include BPM Type Converter check box. The following options are available:

Working with an 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.

Configuration

Specify the mail server configurations.

Parameters

You can map parameters from the mail object to a process data.

Converter

Use this tab to specify how the email content is converted.

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.

Configuration

Parameters

Split

Using this tab, users can specify how message content should be splitted.

Converter

Use this tab, to specify how the message content is converted by selecting the Include BPM Type Converter check box. The following options are available:


Figure: Message Event - Converter

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 Infinity Process Platform 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

Configuration

Parameters

Converter

Use this tab to specify how the input content is converted. Select the Include BPM Type Converter check box. The following options are available:

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

Hiding Camel Trigger user's password in log file

To avoid getting a Camel Trigger user's password logged in log file/console, you should add the following beans in your default-camel-context.xml to define a custom Camel trace formatter.

<bean id="traceFormatter" class="org.eclipse.stardust.engine.extensions.camel.log.TraceFormatter"/>

<bean id="messageInterceptor" class="org.eclipse.stardust.engine.extensions.camel.intercept.MessageInterceptor" />

The trace formatter will replace ippPassword value by "xxxxxx" in the console/log file as in the example follow:

16:41:51 INFO Tracer - (Consumer-2047060833) setHeader[ippPassword] --> setHeader[ippUser] <<< Pattern:InOnly, Headers:
{CamelFileNameOnly=input.txt, CamelFileLastModified=1411627943032, CamelFileRelativePath=input.txt, ippPassword=xxxxxx, 
breadcrumbId=ID-ap-pun-ws1678-54110-1418123348304-0-1, ippTriggerId=ManualTrigger1, ippModelId=FileEvent, 
... 
} 

If you want to hide the value of other headers; then you should define a filterHeaders property. In the following example, the values of breadcrumbId, ippUser and ippPassword are hidden.

<bean id="traceFormatter" class="org.eclipse.stardust.engine.extensions.camel.log.TraceFormatter">

   <property name="filterHeaders" value="breadcrumbId,ippUser,ippPassword" />

</bean>

Following is the example log file:

16:59:20 INFO Tracer - (Consumer-2047060833) setHeader[ippUser] --> setHeader[ippPartition] <<< Pattern:InOnly,
Headers: {camelfileparent=C:\ISB\Events\data, ipppassword=xxxxxx, ippuser=xxxxxx, breadcrumbid=xxxxxx,
ippprocessid=TestFileEventProcess, camelfilerelativepath=input.txt, ippmodelid=FileEvent, camelfilename=input.txt,
.........} 

Working with Timer Events

Using the timer event, you can:

Configuration

You can specify following configuration details for timer event:

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 starts 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"/>

For more information about the Quartz endpoint, please refer this link.

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 exceptions such as Cannot find process definition in case events happen. (For example, 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 an End Event


Figure: End Event - Properties

Implementation

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

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: End 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.