Triggering a signal from anywhere to cancel the process

cancel
Showing results for 
Search instead for 
Did you mean: 
qdeme
Member II

Triggering a signal from anywhere to cancel the process

Hi,

We are currently using Activiti in my company and are wondering how to achieve the following.

In short : we would like to be able to cancel the process at anytime and from anywhere in the diagram.

An ideal design would look like :

With the "Signal Catching Event" symbol being triggered by a signal (signal ref on a specified signal).

But we have the feeling that it should not be used that way... and when searching a little more in the documentation, we tried to do the following :

With a Signal Boundary Event on a subprocess.

But when we try to trigger the associated signal, "cancelSignal", by doing runtimeService.signalEventReceived("cancelSignal"), or runtimeService.signalEventReceived("annulationSignal", "117505") with the execution Id, the following exception is thrown :

Execution 117505 has not subscribed to a signal event with name "cancelSignal"

Could you please help us find the right solution for this use case?

Many thanks in advance

1 Reply
gdharley
Intermediate

Re: Triggering a signal from anywhere to cancel the process

Have you tried using an event sub process that triggers on a signal event and have it end in a "terminate" end event rather than a normal ent event. Terminate end events cancel all active tasks and exit the process immediately.

I can attach a diagram if you need.

Thanks,
Greg