cancel
Showing results for 
Search instead for 
Did you mean: 

Start subprocess on signal

jolo_
Champ on-the-rise
Champ on-the-rise
I start embedded subprocess on signal, all works like in example http://forums.activiti.org/comment/13412#comment-13412.

What I do:
1. Launch process
2. runtimeService.signalEventReceived("launchCandidateSubprocessSignal")
3. End Process

Problem:
When I start the process first time - all works fine. But if I start it the second time - it launch TWO subprocess, the third - THREE subprocess, and so on.

Bad way to resolve it:
I noticed that if to clear ACT_RU_EVENT_SUBSCR table each time, all works fine.

Question:
1. How to correctly populate signals?
2. Does it acceptable to clear the ACT_RU_EVENT_SUBSCR table on main process start

2 REPLIES 2

jolo_
Champ on-the-rise
Champ on-the-rise
Seems I know the answer - I didn't complete subprocess. So the table ACT_RU_EVENT_SUBSCR wasn't cleaned. 

But there are many situations when I won't complete my subprocess, for example, during app development I want to stop the whole process.

Question: how to correctly avoid the problem above? Means multiple invokation on single signal.

trademak
Star Contributor
Star Contributor
The signal event broadcasts the event to every running process instance with that signal name, so it's clear that this is expected behavior. If you don't want this behavior you could add a specific execution id to your signalEventReceived method call

Best regards,