Pass Variables Between Pools

@withnoe, To communicate between different pools you can use MessageEvents. Read more about How to correlate message events in camunda.

// correlate the message
MessageCorrelationResult result = runtimeService.createMessageCorrelation("messageName")
  .processInstanceBusinessKey("AB-123")
  .setVariable("payment_type", "creditCard")
  .correlateWithResult();

When starting a process instance, a message start event can be triggered using the following methods on the RuntimeService:

ProcessInstance startProcessInstanceByMessage(String messageName);

ProcessInstance startProcessInstanceByMessage(String messageName, 
             Map<String, Object> processVariables);

ProcessInstance startProcessInstanceByMessage(String messageName, 
             String businessKey, Map<String, Object> processVariables);

At higher level, you can refer this post:

Reference model:

image

1 Like