Message Correlation
Message Correlation
In order for messages to be able to be sent back and forth between organizations with potentially multiple of the same process plugin instances running at the same time and still arriving at the correct process instance, some mechanism is needed to map messages to their rightful process instance. This mechanism is called Message Correlation and requires attaching a unique identifier to every process instance. This identifier is called the business-key
. The business-key
will get attached to every outgoing message automatically.
It is possible that the business-key
is insufficient to map messages to the correct process instance. This happens during subprocesses in your BPMN model which all expect messages to be sent to them, not the parent process. To solve this issue, Task resources also come with an Input Parameter called correlation-key
. This is a secondary identifier that has to be attached to all messages in order for them to arrive at a specific subprocess. This is done when creating targets for outgoing messages and requires setting the correlation-key
as a local variable using the constant BpmnExecutionVariables.CORRELATION_KEY
before a message is received in the subprocess.