Event Subprocess with variable reference in message - process fails to start

I am creating a process instance using the REST API:

http://localhost:1444/process-definition/key/process-key/start

The request body contains variables:

“variables”: {“var1”: {“value”: “var1value”}}

I have an event sub-process in process scope with message name “my-message-${var1}”.

When starting the process, a ProcessEngineException is thrown on the creation of the event subscription:

Could not find property workcaseId in class org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:63)
at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:51)
at org.camunda.bpm.engine.impl.bpmn.parser.EventSubscriptionDeclaration.resolveExpressionOfEventName(EventSubscriptionDeclaration.java:173)
at org.camunda.bpm.engine.impl.bpmn.parser.EventSubscriptionDeclaration.createSubscriptionForExecution(EventSubscriptionDeclaration.java:155)

The process needs to continuously listen for this event and the variable is necessary to ensure successful correlation. How else can this be achieved? It looks as though the variable is not available at the point of subscription creation.

Hi @raptellect,

It seems only works with businessKey

<bpmn:message id="Message_149g32a" name="msg_${execution.processBusinessKey}" />

Kindly find attached an example model
test-process.bpmn (4.1 KB)

POST /process-definition/key/{key}/start

{
 "businessKey" : "myBusinessKey"
}