Ability to require variable correlation on a Message Event Catch?

Is it possible to require a Message Catching event to require correlation using specific variables?


Message: “myMessageName”.
I could POST a message to camunda Rest API with that specific message name with and without a correlation key(s).


Hi @StephenOTT,

I’m not sure entirely sure I get the question. So you’d like to define that a message event requires foo and bar to be present in the set of correlation keys or else an expcetion should be raised?


Yes. Is this currently possible?

I am afraid not. You could implement CorrelationHandler or extend the default implementation and plug it into the engine via property correlationHandler.

Could this be done with an Execution Listener? (Event Type: Start)

I don’t think so: A listener on start is invoked before the event subscription is persisted and the message is correlated. A listener on end is invoked in the transaction that correlates the message, so throwing an exception there would do the trick. But I think there is no sane way of accessing the correlation keys from within the listener.

^ This was my guess :slight_smile:

This would be a great feature (IMO), as would allow using generic message names for broad Message correlation and specific message correlation at the same time.

Hi @StephenOTT,

Maybe I misunderstood you, but can’t you just use expressions in the message name in order to achieve that? See the documentation for more information.


Yes thats been my fallback. But was looking at ways to be able to use the same message name to deliver targeted and broad correlated messages. If i use the dynamic message name, I have hyper-targeted delivery (single message for a single message event), but i lose the broad messaging (one message correlating to many message events).


I’d be interested to use a dynamic name of a Message Start Event of a an Event Sub Process but how would this work with the REST /message API?
Let’s say I define the following message start event:

If another systems wants to call the API to trigger this message, for example call:

“messageName” : “TypeA_Msg_arrived”,
“processInstanceId” : “671ec874-6979-11e8-ad76-589920524153”,
“resultEnabled”: “true”

then he needs to put a specific name in the messageName field. How can this be resolved to my dynamic name?