Search code examples
camundacamunda-modelercamunda-plugin

How can i transfer data from 2 process pools result to 3rd process pool using event name without creating multiple instances in camunda?


I have 3 process pools in camunda and I implemented to send variables from 1st instance to 2nd instance by using Expression implementation with using event-name(A) and I'm trying to send 1st process pool variables to 2nd,3rd process pools and also sending 2nd process pool result to 3rd process pool, basically 3rd process pool will receive input from 1st and 2nd process pools but values are not sending. how can I achieve this with creating only one instance. I used below code to send data and successfully received in 2nd process pool.

${execution.getProcessEngineServices().getRuntimeService().createMessageCorrelation("A").setVariable("A","A").correlateWithResult()}

BPMN diagram


Solution

  • Ok, I still haven't got why you just can pass through the variables.

    Here is the solution I came up: enter image description here

    Some Remarks:

    • I used your expression to send the messages. I am not sure if it is possible to send 2 messages in one event.
    • I used a signal from B to C because messages did not work (I am not sure why).
    • Anyhow you need to correlate the signal or the message that it matches the correct process (with Signals you can define dynamic names).

    And here the prove that it works: enter image description here

    See Gist: https://gist.github.com/pme123/22e7ab46f12218b7e399913af3115cf6