This chapter covers the following:
This option is available only when you switch to Integrator profile. Using this option, you can specify implementing event to initiate the process.
Figure: None - Implementation
Figure: Message Event - Implementation
Figure: Timer Event - Implementation
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.
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.
Figure: File Event - Configuration
Figure: File Event - Parameters
Using this tab, users can specify how the file content is split.
Figure: File Event - Split
Use this tab to specify how the file content is converted. Select the Include BPM Type Converter check box. The following options are available:
Figure: File Event - Converter
The email event overlay allows to start a process by receiving an incoming email, and passing all the information contained as input data.
Specify the mail server configurations.
Figure: E-mail Event - Configuration
You can map parameters from the mail object to a process data.
Figure: E-mail Event - Parameters
Use this tab to specify how the email content is converted.
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.
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>
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.
jms. This is a mandatory field.
Figure: Message Event - Configuration
Figure: Message Event - Parameters
Using this tab, users can specify how message content should be split.
Figure: Message Event - Split
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
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:
Figure: Scan Event - Implementation
defaultCamelContext is
provided. This field is mandatory.
Figure: Generic Camel Route Event - Configuration
Figure: Generic Camel Route Event - Parameters
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
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,
.........}
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 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.
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>
To add comments for events, perform the following steps:
Figure: Start Event - Comment Icon
Figure: Start Event - Add Comment
Figure: End Event - Properties
The UUID and ID options are displayed only when you switch to Integrator profile.
This option is available only when you switch to Integrator profile. However, note that an Implementation option is not available for the end event.
To add comments for events, perform the following steps:
Figure: End Event - Comment Icon
Figure: End Event - Comment