Hi there, i have a question regarding the correlation message event.
So i have created two process definitions. One process definition has a message intermediat event where all my Instances wait to be correlated. In the second process definition I have a Service Task where i want to correlate a pspecific process instance. Something like: runtimeService.createMessageCorrelation(“AufrufMessage”)
.processInstanceId("instnce id ")
.processDefinition("definition id ")
.correlate();
I cant seem to get it right. Can you actually do something like this?
Hi @Teodora, yes, it is possible to constrain the message correlation to a specific process instance id - this is based on my reading of the Camunda 7 API docs.
Setting the process definition on the fluent builder returned by createMessageCorrelation is not valid (on 7.21). And anyway, by specifying the process instance ID it would be redundant (as a process instance can only be created from a single process definition)
Just for the record: process definition id is not the same as the process model key. Definition id is an unreadable value which is randomly generated when a process model is deployed. That was probably the reason why your correlation didn’t work.
As @herrier wrote, process instance Id as the correlation condition should be enough.