I am newbee in Camunda BPMN 2.0, i need help on how to implements and use send and receive task from one pool to another.
Attach a JavaDelegate implementation to the send task:
<sendTask id="sendTask" camunda:class="org.camunda.bpm.MySendTaskDelegate" />
Inside the MySendTaskDelegate
, correlate a message to the receive task in the other process instance:
public class MySendTaskDelegate implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception {
execution.getProcessEngineServices()
.getRuntimeService()
.createMessageCorrelation("someMessage")
.processInstanceBusinessKey("someBusinessKey")
.correlate();
}
}
This assumes, that
someBusinessKey
. The business key can be provided when starting the process instance.someMessage
. The message name for a receive task can be specified in BPMN 2.0 xml using the <message ... />
element. See: http://docs.camunda.org/latest/api-references/bpmn20/#tasks-receive-task