AnsweredAssumed Answered

How to trigger event for event based gateway in java

Question asked by shobhit on Jun 5, 2017
Latest reply on Jun 6, 2017 by daisuke-yoshimoto

Hi I am trying to implement event based - gateway as shown in example of activiti user guide Activiti User Guide .


Only difference in below mentioned image and my model  is that there is a service task (lets call it task T) between start event and event-based gateway.



I am firing event in this service task T as:


runtimeService.signalEventReceived("signalEvent" , execution.getId());


But its not working and control flow is not going to user task : Handle alert

I also want that this alert goes to event gateway of this process instance and not to any other execution. 


Can anyone help?


<definitions id="definitions" xmlns="" xmlns:activiti="" targetNamespace="Examples"> <signal id="alertSignal" name="alert" /> <process id="catchSignal"> <startEvent id="start" /> <sequenceFlow sourceRef="start" targetRef="gw1" /> <eventBasedGateway id="gw1" /> <sequenceFlow sourceRef="gw1" targetRef="signalEvent" /> <sequenceFlow sourceRef="gw1" targetRef="timerEvent" /> <intermediateCatchEvent id="signalEvent" name="Alert"> <signalEventDefinition signalRef="alertSignal" /> </intermediateCatchEvent> <intermediateCatchEvent id="timerEvent" name="Alert"> <timerEventDefinition> <timeDuration>PT10M</timeDuration> </timerEventDefinition> </intermediateCatchEvent> <sequenceFlow sourceRef="timerEvent" targetRef="exGw1" /> <sequenceFlow sourceRef="signalEvent" targetRef="task" /> <userTask id="task" name="Handle alert"/> <exclusiveGateway id="exGw1" /> <sequenceFlow sourceRef="task" targetRef="exGw1" /> <sequenceFlow sourceRef="exGw1" targetRef="end" /> <endEvent id="end" /> </process> </definitions>