Expressions in Signal Start event

I am attempting to use a process variable within a signal start event expression. The process variable is passed in when the process is started. It seems that the engine is evaluating the expression before the variable is instantiated and attempts to start the process result in an error:

Unknown property used in expression: delete-${orderProductId}. Cause: Cannot resolve identifier ‘orderProductId’ [ start-instance-error ]

Is this expected behavior? Is there another technique to create a unique ID for a signal-listener?
Test subprocess.bpmn (7.9 KB)

Hi @Bill_Powell,

I see that you are using event sub-process and if I am not mistaken, the intended behavior is to have it triggered (started) as per process instance.

I believe message event should be used instead of signal so while your main process is running, a message can be thrown with the process variable “orderProductId” specified as correlation key.

Thank you, @hassang. The reason we are using Signal is that we may have many processes with this same orderId and we wish to end them all with a single signal. We could use a message with correlateAll, but we prefer to avoid that. The documentation states that expressions within Signal are valid. Signal-Expressions

1 Like

I believe this is true with intermediate catch events or boundary events but not with start events.

I believe that you can try embedding your logic within an embedded process then attaching signal event to it. I didn’t try it but it should work.

Yes, that does work. But in that case only the sub-process is terminated, and I wish to terminate the entire process.
Test subprocess.bpmn (7.9 KB)

I found a solution that works. Thanks @hassang
Test subprocess.bpmn (8.5 KB)

1 Like

What I suggested is to use signal event as boundary event attached to a super embedded process but your solution is more elegant.

1 Like

One note:

In your solution, you need to use a terminate event instead of regular end event after Task 3 to kill the signal catch event.

Here is what I suggested. (If someone finds it helpful)

1 Like