cancel
Showing results for 
Search instead for 
Did you mean: 

Paranormal Activiti: Signal Intermediate Events Problem

se040
Champ in-the-making
Champ in-the-making
Hi,

i've been trying to use Signal Intermediate Events in a process but it doesn't work.

Its a simple process, where 2 paths are executed paralell and the one path has a catch followed by a script task (simple syso) and the other one a script task followed by a throw signal intermediate event. So basically i expect this to work fine but for some reason only the throw part finishes (into a paralell join) and the other path is waiting. After testing for some time (also tried throwing signal event replacement by using a ServiceTask to throw) i noticed that at the time of the throw there was no execution listening for that event. I suppose both parts for that matter are not executed in paralell on the engine, because when i used a JUnit Test in which i started this process first, afterwards searched for executions listening to "Test" I found one and was able to throw the signal manually. How can i make that work without crazy workarounds? Is there a way to make the execution parts really paralell or is it just me screwing up Smiley Happy ?

I appreciate any help on this! Thanks in advance.

[img]http://imageshack.us/a/img685/4240/simpleprocess.png[/img]

    <signal id="test" name="Test"></signal>
      …..
    <intermediateCatchEvent id="catchTest" name="SignalCatchEvent">
      <signalEventDefinition signalRef="test"></signalEventDefinition>
    </intermediateCatchEvent>
      …..
    <intermediateThrowEvent id="throwTestSignal" name="throwTest">
      <signalEventDefinition signalRef="test"></signalEventDefinition>
    </intermediateThrowEvent>

Best regards,
Stefan

(I'm sorry for the title but i couldn't resist that pun Smiley Wink )
2 REPLIES 2

jbarrez
Star Contributor
Star Contributor
The problem you are seeing here is that the Activiti engine handles the parallel gateway sequence flow in the order in which they are defined. As you probably know, Activiti doesn't use real concurrency for this. In this case, the signal catch hasn't been created yet when the throw is done.

An easy 'fix' would be to switch the sequenceflow. ie. first the one with the catch, then the throw. Sorry about that, but that's just the way the engine works. Introducing real concurrency here would create so much more issues (race conditions, deadlocks, etc.) than it would solve.

se040
Champ in-the-making
Champ in-the-making
Works fine after switching both flows. Thank you!