Integrating Activiti BPM with JMS

Activiti is a light-weight workflow and Business Process Management (BPM) Platform targeted at business people, developers and system admins. However, its standard version doesn’t allow to integrate with your existing enterprise technologies (e.g. your JMS broker). In this post we will briefly explain how to integrate Activiti with JMS using Mule’s Activiti Module.

First, you will need to run Activiti in embedded mode inside your Mule application; it is pretty similar to run Activiti inside Spring. An example configuration is shown next; you will need to define your processEngineConfiguration and the service beans you can obtain from it:

Then you will also need to define your JMS broker; in our case we will use Active MQ:

Finally, your Mule’s Activiti connector:

We are ready!
For our example, let’s suppose we have a process for managing orders that waits for the approval of a manager:

The manager approves them by submitting a message to the JMS queue approveQueue. To resolve which process needs to be approved the message must contain the process id and the username which will be set in the approvedBy variable. For the sake of conciseness, we will create the process from Mule as shown next:

This process will start and wait for a message in the JMS queue to signal it. This can be easily solved from the Mule side by specifying a flow that reads from a JMS queue, sets the variable approvedBy and signal the process as shown next:

Want to see the full example? Check our git hub repository for Activiti examples. Hope you want to start integrating Activiti with your existing enterprise environment using Mule’s Activiti Module and I look forward to your comments.

3 Responses to “Integrating Activiti BPM with JMS”

  • Thorsten Vetter Says:

    Hi Esteban,
    you are referencing mule-module-activiti 3.2.1. From which repository can I get that version?
    Best regards

    • Esteban Robles Luna Says:

      Hi Thorsten,
      It is not published yet. You can checkout the code from the git hub repo and build it with the following command (assuming you have already installed maven):
      mvn clean install -DskipTests

  • Thorsten Vetter Says:

    That’s a great feature for asynchronous processing

Leave a Reply