Using JMS Application and JMS Trigger

This tutorial helps you to work with JMS application and JMS trigger.

Using this example, you can:

While creating this tutorial, it is assumed that you have the knowledge of JMS 1.1 specifications. For more information on JMS, please refer the chapter Integrating JMS of the Modeling Guide.

Importing the Example Model

You can download the tutorial ZIP file containing the example source code as well as the complete model:

You find the sources for this tutorial in the jms folder of the ZIP file.

Working with JMS Application

We are creating two JMS applications. One application is used to send the request and another application is used to give response to the request. So, let's create a model.

Creating a Model

Perform the following steps to create the JMS application model.

  1. Create a process named JMS_ApplicationProcess
  2. Create two manual activities named Manual Activity 2 and Manual Activity 3
  3. Similarly, create two application activities named Sender and Reciever
  4. Create three primitive data named Primitive Data 1 of String type, Primitive Data 2 of String type and Process OID of long type
  5. Create two JMS applications named JMS Application 1 and JMS Application 2

Setting Properties of JMS Application 1

  1. Open the properties of JMS Application 1
  2. Select JMS Application in the left pane of the properties page and then select Request check box as a type
  3. JMS Application - Request
    Figure: In Data Mapping - Sender

  4. Select Request from the left pane of the properties page to specify the request specific parameters
  5. Specify the following request parameters
  6. Request Parameters
    Figure: Request Parameters

    Note that you need to create the Connection Factory JNDI and Queue JNDI as per your requirement.

  7. Select Request from the left pane and click Add to specify request access points
  8. Specify Test_String as a request access point as shown in the following screenshot:
  9. Request Access Point
    Figure: Request Access Point

  10. Specify processInstanceOID as a request access point as shown in the following screenshot:
  11. Request Access Point
    Figure: Request Access Point

  12. Specify activityID as a request access point as shown in the following screenshot:
  13. Request Access Point
    Figure: Request Access Point

    Note that the default value is the ID of the activity Reciever.

Setting Properties of JMS Application 2

  1. Open the properties of JMS Application 2
  2. Select JMS Application in the left pane of the properties page and then select Response check box as a type
  3. JMS Application - Response
    Figure: JMS Application - Response

  4. Select Response from the left pane to specify the response specific parameters
  5. Specify the following response parameters
  6. JMS Application - Response
    Figure: Response Parameters

  7. Select Response from the left pane and click Add to specify response access points
  8. Specify Test_String response access point as shown in the following screenshot:
  9. Response Access Point
    Figure: Response Access Point

Specifying Data Mappings

  1. Specify the following In Data Mappings for the application activity Sender
  2. In Data Mapping - Sender
    Figure: In Data Mapping - Sender

  3. Specify the following In Data Mappings for the application activity Sender
  4. In Data Mapping - Sender
    Figure: In Data Mapping - Sender

  5. Specify the following out data mapping for the application activity Reciever
  6. Out Data Mapping - Reciever
    Figure: Out Data Mapping - Reciever

  7. Specify the following In Data Mapping for the Manual Activity 3
  8. In Data Mapping - Manual Activity 3
    Figure: In Data Mapping - Manual Activity 3

  9. Connect manual trigger and these activities to each other. The created model would like as shown in the following screenshot:
  10. JMS Application Process
    Figure: JMS Application Process

Deploying the JMS Model

Perform the following steps:

  1. Start the application server
  2. Configure JMS connection factory and connection queue
  3. Deploy the model
  4. Start the Infinity Process Platform Portal as described in the chapter Logging in the Infinity Portal of the End User Handbook. Login as administrator (motu/motu). You can use the Shift-F8 short key.

Executing the Workflow

Perform the following steps:

  1. In the Workflow Execution perspective, start the JMS_ApplicationProcess.
  2. Specify the input in the Primitive_1 text box and complete the activity
  3. Send Data
    Figure: Send Data

    As soon as you complete the activity, the JMS application activity receives the data and send it to the Reciever application activity. The Reciever activity sends that to the manual activity 3 and then the manual activity 3 displays the received data.

    Send Data
    Figure: Data Received

Working with JMS Trigger

We are creating a process named Process_Sender and Process_Trigger. In the JMS application request access point, the default value is specified as Process_Trigger - the ID of the process in which JMS trigger is defined. Process_Sender request is sent to the Process_Trigger. The Process_Trigger gives the response to this request.

Creating a Process named Process_Sender

So, let's create a process called Process_Sender which sends the request to the Process_Trigger. Then, create a process called Process_Trigger.

Perform the following steps:

  1. Create a manual trigger
  2. Create a manual activity named Enter Text and create an application activity named JMS_APP1
  3. Create a JMS application named JMS_Sender
  4. Create a primitive data named Sended_Data of type String
  5. Open the properties of the JMS_Sender application
  6. Select JMS Application from the left pane and select Request check box as a type
  7. JMS_Sender - Request
    Figure: JMS_Sender - Request

  8. Select Request from the left pane of the properties page to specify the request specific parameters
  9. Specify the following request parameters
  10. JMS_Sender - Request Parameters
    Figure: JMS_Sender - Request Parameters

  11. Select Request from the left pane and click Add to specify request access points
  12. Specify TextData as a request access point as shown in the following screenshot:
  13. Request Access Point
    Figure: Request Access Point

  14. Specify processID as a request access point as shown in the following screenshot:
  15. Request Access Point
    Figure: Request Access Point

    Note that the ID of the Process_Trigger is specified as the default value which calls the process named Process_Trigger.

  16. Specify the following out data mapping for the manual activity Enter Text
  17. Enter Text - Out Data Mapping
    Figure: Enter Text - Out Data Mapping

  18. Specify the following in data mapping for the application activity JMS_APP1
  19. JMS_APP1 - In Data Mapping
    Figure: JMS_APP1 - In Data Mapping

The created process would like as shown in the following screenshot.

Process_Sender
Figure: Process_Sender

Creating a Process named Process_Trigger

The Process_Trigger specifies the trigger parameters to call the Process_Sender process.

Perform the following steps:

  1. Create a JMS trigger
  2. Create a manual activity named Display Text
  3. Create a primitive data named Received Data of type string
  4. Create the in data mapping for the activity Display Text
  5. In Data - Display Text
    Figure: In Data - Display Text

  6. Open the properties of the JMS trigger
  7. Select JMS Trigger from the left pane of the properties page
  8. Specify the following trigger specific parameters
  9. JMS Trigger
    Figure: JMS Trigger Parameters

  10. In the Properties page, select JMS Trigger and click Add to specify out access point
  11. Specify content as the out access point as shown in the following screenshot
  12. JMS Trigger
    Figure: JMS Trigger - Out Access Point

  13. Select Parameter Mapping from the left pane of the properties page and click Add
  14. Parameter Mapping
    Figure: Parameter Mapping

  15. Specify the parameter mapping as shown in the following screenshot:
  16. Parameter content
    Figure: Parameter content

The created process would look like as shown in the following screenshot:

Process_Trigger
Figure: Process_Trigger

Deploying the Model

Perform the following steps:

  1. Start the application server
  2. Configure JMS connection factory and connection queue
  3. Deploy the model
  4. Start the Infinity Process Platform Portal as described in the chapter Logging in the Infinity Portal of the End User Handbook. Login as administrator (motu/motu). You can use the Shift-F8 short key.

Executing the Workflow

Perform the following steps:

  1. In the Workflow Execution perspective, start the Process_Sender process
  2. Enter details in the Enter Text manual activity and complete the activity
  3. Enter Text
    Figure: Enter Text

    The JMS_APP1 application sends this request to the Process_Trigger. That's why the call gets forwarded to the Process_Trigger process.

  4. Refresh the My Processes panel and start the Process_Trigger process
  5. The Display Text activity of the Process_Trigger receives the data and displays it.

    Response from JMS Application
    Figure: Response from JMS Application