How to catch events via message boundary event from parallel multi instance

My requirement is catching event sending from the worker in the inner parallel sub process.


What I did is, defined a non inturrupting message boundary event and called engine-rest/message camunda rest api in the Work service task. But every time it gives following error.

{

    "type": "RestException",
    "message": "org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message 'workError': No process definition or execution matches the parameters"
}

I did lot of changes to request body to get a success result. but couldn’t get succeed. below is my request body.

{
    "messageName": "workError",
    "processInstanceId": "6c4a526c-b3f6-11ed-b1c2-0242ac120004",
    "localCorrelationKeys": {
        "workName": {
            "value": "Test1"
        }
    }
}

I defined this workName variable in inner sub process. but the result is same.
If some one has an idea about what to do, it would be great help for me. Thank you.

Hello @Hasitha_Rajasinghe ,

i had a similar problem some years ago.

By this time, I solved it by using a parallel multi-instance call activity.

From there, doing the correlation was easier.

I hope this helps

Jonathan

1 Like

Thank you @jonathan.lukas ,

Could you please show me how to change my above BPMN to achieve the solution?
(Just an sketch of a BPMN diagram will be enough)

Thanks.

Hello @Hasitha_Rajasinghe ,

here is my proposal:

The most important advantage here is that you can actually scope the business key through the call activity so that each Work task actually has its own business key which allows you to correlate very specific (and with a high performance).

Tip: In Camunda 8, the messages are correlated using a correlation key which allows much more flexibility.

I hope this helps

Jonathan