Dynamic signal start event name

Hello,

I try to create a non interrupting sub process with a dynamic start event name (ie: name=“signal_${type}”):

But I face multiple errors:

If I have only one process, it fails at deployment type:

org.camunda.bpm.engine.ProcessEngineException: Unknown property used in expression: signal_${type}. Cause: Cannot resolve identifier 'type'
	at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:60) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:48) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.bpmn.parser.EventSubscriptionDeclaration.resolveExpressionOfEventName(EventSubscriptionDeclaration.java:170) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.bpmn.parser.EventSubscriptionDeclaration.createSubscriptionForStartEvent(EventSubscriptionDeclaration.java:137) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.addSignalStartEventSubscription(BpmnDeployer.java:384) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.addEventSubscription(BpmnDeployer.java:288) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.addEventSubscriptions(BpmnDeployer.java:277) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.adjustStartEventSubscriptions(BpmnDeployer.java:226) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.definitionAddedToDeploymentCache(BpmnDeployer.java:140) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.definitionAddedToDeploymentCache(BpmnDeployer.java:67) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.registerDefinition(AbstractDefinitionDeployer.java:290) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.persistDefinitions(AbstractDefinitionDeployer.java:217) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.postProcessDefinitions(AbstractDefinitionDeployer.java:199) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.deploy(AbstractDefinitionDeployer.java:63) ~[camunda-engine-7.9.0.jar:7.9.0]

If I have multiple processes in the same BPMN file, it fails when I start it using:

runtimeService().startProcessInstanceByKey("testProcess",Variables.createVariables().putValue("type", "myType"));
org.camunda.bpm.engine.ProcessEngineException: Unknown property used in expression: signal2_${type}. Cause: Cannot resolve identifier 'type'
	at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:60) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:48) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.bpmn.parser.EventSubscriptionDeclaration.resolveExpressionOfEventName(EventSubscriptionDeclaration.java:170) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.bpmn.parser.EventSubscriptionDeclaration.createSubscriptionForExecution(EventSubscriptionDeclaration.java:152) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.initialize(ExecutionEntity.java:396) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.start(PvmExecutionImpl.java:228) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:431) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:59) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:31) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) ~[camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104) [camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66) [camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) [camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.executeWithVariablesInReturn(ProcessInstantiationBuilderImpl.java:162) [camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(ProcessInstantiationBuilderImpl.java:128) [camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(ProcessInstantiationBuilderImpl.java:124) [camunda-engine-7.9.0.jar:7.9.0]
	at org.camunda.bpm.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:101) [camunda-engine-7.9.0.jar:7.9.0]

To make it work I need to create an intermediary scope:

Is it an expected behaviour?
I feel like I should not require a sub scope.

If I replace the signal by a message I got the same issues, however I manage to work around it using correlation variables instead of dynamic names. Unfortunately there is no correlation variables for signals.

This may be a naive question, but did you try to start it via the REST API?

No I’m using the Java API only.