Expression not evaluated on intermediateCatchEvent

Hi

I try to setup a simple process, that waits at a certain point upon a message, using an intermediateCatchEvent.
I set it according to: https://docs.camunda.org/manual/7.8/reference/bpmn20/events/message-events/

In the BPMN XML I have

...
 <bpmn:intermediateCatchEvent id="event-message-go" name="hello-message">
      <bpmn:incoming>SequenceFlow_1iqjlek</bpmn:incoming>
      <bpmn:outgoing>SequenceFlow_1l8zutr</bpmn:outgoing>
      <bpmn:messageEventDefinition messageRef="Message_0clcxrf" />
</bpmn:intermediateCatchEvent>
...
<bpmn:message id="Message_0clcxrf" name="hello-message-${execution.businessKey}" />
...

The event occurs after a simple delegate, that logs the businessKey.

When I test this process, wiht businessKey=“TestOk”, and try to correlate a message named “hello-message-TestOk”, it fails with
ENGINE-16004 Exception while closing command context: Cannot correlate message 'hello-message-TestOk': No process definition or execution matches the parameters

When investigating, I used:
List<EventSubscription> events = processEngine.getRuntimeService().createEventSubscriptionQuery().list();
and saw that the event registered name is “hello-message-”

And when I try to correlate with “hello-message-”, correlation is ok.

Is it a bug or an exepected behaviour? If so, how can I set the name based on the businessKey?

Hi @garnoud,
can you post you model please?
Also you can try to use ${execution.processBusinessKey} instead of ${execution.businessKey}.

Cheers
Svetlana

That did the trick. It’s a doc bug, no?

Actually it was fixed recently in docs: https://docs.camunda.org/manual/latest/reference/bpmn20/events/signal-events/#expressions

Execution can have businessKey in some cases and it can be different from processBusinessKey, but the simplest use case is with processBusinessKey -> this case must be in docs.

Oh, sorry, this is another documentation page. I will fix the one with message events also!