cancel
Showing results for 
Search instead for 
Did you mean: 

Signal specific execution after Event-based Gateway

alef
Champ in-the-making
Champ in-the-making
Hi all,
I need to implement something similar to the following example reported in the Activiti user guide:
http://www.activiti.org/userguide/#eventBasedGatewayExample

I could have several processes waiting for a signal, but what I need is send a signal only to a specific execution.

I tried to use this statement
runtimeService.signalEventReceived("alert", executionId);


but I got this exception
org.activiti.engine.ActivitiException: Execution '12501' has not subscribed to a signal event with name 'alert'.
1 REPLY 1

alef
Champ in-the-making
Champ in-the-making
I have omitted that I need send a signal starting from a processInstanceId.
So I've solved in this way:
<java>Execution execution = runtimeService.createExecutionQuery()
           .signalEventSubscriptionName("alert")
           .processInstanceId(processInstanceId)
           .singleResult();   
   
runtimeService.signalEventReceived("alert", execution.getId());</java>