Search code examples
javamulemule-studioactivitibpmn

Invoking a mule non-webservice flow from Activiti


I have a JMS mule flow, which will read messages from a queue and process them. I would like to invoke this flow from a process in Activiti. I am using a remote mule instance. From what I understand, to invoke a mule flow in a remote mule instance, I have to use web service. How can I use web service in this case?

I am using the community edition of mule.

Thanks


Solution

  • Assuming you know the Web Service URL for your remote Mule instance, you would need to do one of two things:

    1. Create a serviceDelegate class that calls the Web Service endpoint and call this from Activiti
    2. Use the Camel module with Activiti to handle the call to Mule

    Personally I am a fan of using Camel for this sort of thing since the hard work has already been done for you and it is a relatively simple matter to create a camel route and call it from an Activiti service task (there are even BPMN extension attributes built into the latest versions of Activiti that make this even easier).

    Other things to consider. Is this a fire and forget (i.e. one way) call or are you expecting a response? If you are expecting a response, will it be synchronous or asynchronous? All these factors will impact how you model the BPMN flow to properly integrate the Mule flow.