Hi there,
I have got a process, which waits for a REST request from another system in a “Message Intermediate Catch Event”.
Here ist my process:
In the camunda modeler I can give a name to the message by clicking on the catch event and then fill out “Details”:
If I now start the process and fill out the form an the usertaks, the process waits at the message intermediate catch event for my message. I send the following via postman:
via: localhost:8080/engine-rest/message
{
"messageName" : "FormChecked_OneLane_TwoUser",
"processVariables" : {
"permissionApproved" : {"value" : "approved", "type": "String" },
}
}
The following flows (yes and no) check via a method if my REST call sends approved or denied,
That works great.
But I get a problem, if two or more instances wait at the message intermediate catch event
Screenshot from cockpit:
I get an “MismatchingMessageCorrelationException”:
…Cannot correlate a message with name ‘FormChecked_OneLane_TwoUser’ to a single execution. …
I understand it in the way, that I have to identify, for which processInstance the sended message is for.
But how can I do that? My external application could send the processInstance like this:
{
"messageName" : "FormChecked_OneLane_TwoUser",
"processVariables" : {
"permissionApproved" : {"value" : "approved", "type": "String" },
"processInstanceId" : {"value" : "e8dbdd8-92ef-11ec-8065-a434d96233af", "type": "String" }
}
}
But how can I receive it? I tried it with setting the processinstance id in the input parameters via the modeler, but that does not work.
An example would be great. Thank you a lot,
Nicole