Message correlation to a process

Hi, I recently read about asynchronous communication in a book Practical Process Automation for Modern Architectures from Mr. Ruecker. There is a recommendation to use UUID as a correlation ID, using IDs from the workflow engine are not recommended. However, in your documentation about Messages, in a part about Message cardinality, there is mentioned that a message is correlated to a process based on the BPMN process id. As I might misunderstood something, could you please explain me how is it meant?

1 Like

Hi @alena :wave: and welcome to our forums :balloon:

When a process is deployed, it receives a version number. If you make changes to the process and re-deploy it, the version is increased if the BPMN Process ID is the same as before. If the BPMN Process ID also changed, it is considered to be another process altogether.

Instances can be created of any of these versions. For example, you end up with two process instances of different versions of the same process when you:

  • deploy a process,
  • then create an instance,
  • then deploy another version of the same process,
  • and then create another instance.

A message is correlated only once to a process (based on the BPMN process id), across all versions of this process. If multiple subscriptions for the same process are opened (by multiple process instances or within one instance,) the message is correlated only to one of the subscriptions.

This means that a message is only correlated to either one of the process instances. That is even the case, when both of the instances await the same message by name, and by correlation key.

Does that make sense?

1 Like

Thank you for your quick answer and the explanation about versioning. I thought the only ID needed for correlation is a unique correlation key. Then independently from process instance IDs and process IDs, the first process instance waiting for the message with this correlation key within the workflow engine would get the message and others not.

Hi @alena

I thought the only ID needed for correlation is a unique correlation key.

That is correct. Only the correlation key is needed for the message to be correlated to the correct instance.

The process ID is only mentioned to clarify what constitutes as ‘all versions of this process’ vs. ‘different processes’. This helps set up the paragraph following it:

When subscriptions are opened for different processes, the message is correlated to all of the subscriptions.

So, you don’t have to provide the process ID

EDIT: typo

1 Like