I am working on a new process which will have a timer (the user specifies when an event will run) and also has the ability for the user to run the event now instead of waiting for the scheduled time. So, the user would schedule a time, decide to run it before then and the process should continue now.
However, when I send the signal programmatically with RuntimeService.signalEventReceived(…), nothing happens. What I am expecting to happen is that the timer event is cancelled and the process continues. I tried this method with the specific execution ids and even with no execution id which should signal all processes waiting for this event. I checked the db and see the entry in ACT_RU_EVENT_SUBSCR, so I know that it the process is running and waiting.
Does anyone have an idea why this isn't working? Thanks, Mark
It is hard to guess. May be you could create jUnit test to reproduce the issue. You can have a look on org.activiti.engine.test.bpmn.gateway.EventBasedGatewayTest jUnit tests to see how event based gateway works too.
What I ended up doing is changing this to a message and it worked. I modified the diagram to add a message definition and changed the call from RuntimeService.signalEventReceived(…) to the equivalent RuntimeService.messageEventReceived(…) and it worked as expected. The process continues as soon as the message is sent.
I don't know why there is a difference, but this is working for me.