cancel
Showing results for 
Search instead for 
Did you mean: 

Using Mule task to send messages from Activiti to Mule

annayudkovsky
Champ in-the-making
Champ in-the-making
Hello,

In our project we are using Activiti 5.11 and Mule ESB 3.0. Both are running in separate JVMs.
We are trying to figure out communication piece right now.

As I understand from reading documentation and “Activiti in Action” book in the standalone setup (separate JVMs)
-   Mule ESB communicates with Activiti Engine using Activiti REST API calls;
-   Activiti needs to use web service task or JMS queues to communicate with Mule.

Here is Activiti configuration with Mule task (from Activiti in Action book Chapter 11) :

<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:activiti="http://activiti.org/bpmn"
  targetNamespace="http://www.bpmnwithactiviti.org">

  <process id="helloWorldMule">
    <startEvent id="theStart" />
    <sequenceFlow sourceRef="theStart" targetRef="sendMule" />
    <sendTask id="sendMule" activiti:type="mule">
      <extensionElements>
       <activiti:field name="endpointUrl">
         <activiti:string>vm://in
       </activiti:field>
       <activiti:field name="language">
         <activiti:string>juel
       </activiti:field>
       <activiti:field name="payloadExpression">
         <activiti:expression>${processVariable1}
       </activiti:field>
       <activiti:field name="resultVariable">
         <activiti:string>processVariable2
       </activiti:field>
      </extensionElements>
    </sendTask>
    <sequenceFlow sourceRef="sendMule" targetRef="theEnd" />
    <endEvent id="theEnd" />
  </process>
</definitions>

Is it correct to assume that activity-type = “mule” for the sendTask in the example above is only relevant for embedded configurations when Activiti and Mule are in the same JVM?

Thanks,
Anna Y.
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
<blockcode>Is it correct to assume that activity-type = “mule” for the sendTask in the example above is only relevant for embedded configurations when Activiti and Mule are in the same JVM?</blockcode>

Yes, indeed. If you want to communicate using HTTP/webservices you need the 'regular' tasks for that not the mule task.

Thanks, Joram.

I just wanted to confirm that.

Anna Y.

bogdan_aioanei
Champ in-the-making
Champ in-the-making
Hi guys,

I'm trying to get a working example up and running under the same scenario (activiti and mule running on different JVMs).

You can have a look at my BPMN process in the helloMule file attached.

and at one point from my application I'm calling:

                Map<String, Object> variableMap = new HashMap<String, Object>();
  variableMap.put("var1", "hello");
  variableMap.put("anotherVar", "aloha");
  runtimeService.startProcessInstanceByKey("helloWorldMule", variableMap);

but I get an exception org.activiti.engine.ActivitiException: Failed to read response value

I don't know if I'm doing something wrong in my BPMN process or if the Mule flow is doing something wrong.

Any help with this would be greatly appreciated.
Thank you.