Boundary signal event on subprocess not caught

Hi,

I’m trying to test catching signals on the boundary of a subprocess (as a mechanism for breaking out of the subprocess). My test process looks like:

Screenshot%20from%202018-08-20%2014-11-01

The signal definition is scoped to “processInstance”, as I want to target a specific process instance. When I send the signal via the runtimeService, I use the overloaded signalEventReceived(signalName, executionId), with the executionId being the process instance ID.

I get the following error: Execution ‘7505’ has not subscribed to a signal event with name ‘signal-foo’.

Is this telling me that the process instance itself has no subscription to the signal, because it is the subprocess that has the subscription? Would this work if instead I supplied the ID of the subprocess execution to signalEventReceived? The problem with this is that I don’t have access to the subprocess ID in my particular use case. All I have is the overall process ID. My hope was that sending the signal to a specific process ID would end up delivering the signal to any catching signals within the scope of that process (ie including sub processes), but this seems not to be the case.

Any idea how I can fix this to make it work? All I really want to do is fire some sort of signal or message that lets me short-circuit out of a subprocess that is sitting in a wait state.

Thanks,
Shannon

Hey Shannon,

Is this telling me that the process instance itself has no subscription to the signal, because it is the subprocess that has the subscription?

Yes you are completely right, the execution that is subscribed to the signal is the subprocess and not the process instance itself.

Would this work if instead I supplied the ID of the subprocess execution to signalEventReceived?

Yes it would work.

The problem with this is that I don’t have access to the subprocess ID in my particular use case. All I have is the overall process ID.

This is something that could easily be added through a PR. For example a method in RuntimeService that would look like signalEventReceivedToProcessInstance(String processInstanceId) or add a builder for the signalling in the RuntimeService that would allow you to do this over the API.

In theory you can also achieve what you need (only having the processInstanceId) by using the internal API and the EventSubscriptionEntityManager. However, keep in mind that this is an internal API.

Cheers,
Filip