Unable to trigger Receive message via API , for a Receive message event inside a call activity

Unable to trigger Receive message via API , for a Receive message event inside a call activity:

I have a process in which I have a call activity (send exceptions) inside a call activity (validate and create SO).
In the send exceptions call activity I have a receive message intermediate event (ExceptionResolution) waiting for a response for the exceptions sent from this call activity . I am not able to send a message using the rest api for the ExceptionResolution intermediate message that is inside a call activity.

can you please help ? appreciate a quick response.

POST http://localhost:8080/engine-rest/message
content-type: application/json

{
“messageName” : “ExceptionResolution”,
“processInstanceId” : “fe07cc0d-a623-11e8-af48-f49634ab846c”,
“correlationKeys” : {}
}

exception flow.bpmn (25.8 KB)

Whats the response that the API gives you?

Also the way you have your Event gateway with the looping timers, might also be a issue. Your 1m timer would always be reached, the 3min and 5min timers would not be reached, and if the resolution message was being received while the 1min timer was executing (following that flow), the message for the resolution would not be handled because the token would not be waiting at the event gateway

Something like this is prob going to work better for you:

exception flow.bpmn (16.2 KB)

edit: also note that you could reduce your timers into a single timer and use a Cron Cycle to execute every 1min, 3min, and 5min

The API responded with the following message.

{
“type”: “RestException”,
“message”: “org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message ‘ExceptionResolution’: No process definition or execution matches the parameters”
}

Ya see my messages above about the very probable reason why. If you use the design above, you should be fine.

Thanks for a prompt response Stephen. I am trying to execute the module that you provided.

When I try to send the ExceptionResolutionMessage message via api for my call activity

POST http://localhost:8080/engine-rest/message
content-type: application/json

{
“messageName” : “ExceptionResolutionMessage”
}

I get the following error
{
“type”: “RestException”,
“message”: “org.camunda.bpm.engine.MismatchingMessageCorrelationException: ENGINE-13031 Cannot correlate a message with name ‘ExceptionResolutionMessage’ to a single execution. 2 executions match the correlation keys: CorrelationSet [businessKey=null, processInstanceId=null, processDefinitionId=null, correlationKeys=null, localCorrelationKeys=null, tenantId=null, isTenantIdSet=false]”
}

Does this mean that there are duplicates ? not sure how i can find out which one is the duplicate ?

if you just provide a message name in your /message then it will try to correlate with all processes instances that have a receive event. You need to decide if this is correct or if you need to add more correlation information: see: https://docs.camunda.org/manual/7.9/reference/bpmn20/events/message-events/

(guessing that you run multiple instances, or you still have old instances from your previous version still running).

If you look at this example, you can easily write a unit test to test out the behaviour: https://github.com/DigitalState/Camunda-Spock-Testing/tree/master/End-to-End

1 Like

Thanks a lot for your timely response… you saved me… I tried with businessKey to quickly check and it worked like a charm !!

POST http://localhost:8080/engine-rest/message
content-type: application/json

{
“messageName” : “ExceptionResolutionMessage”,
“businessKey” : “Take3”
}