cancel
Showing results for 
Search instead for 
Did you mean: 

Behavior in case of fork and no join

vram
Champ in-the-making
Champ in-the-making
I have a flow as attached with just a fork , but no join.


When I try to run this, I find the flow in the first path(since it is faster) completes and once the end is reached, the entire process is stopped even though the flow in the second loop is mid way through the execution.

Is this the expected behavior? It would be great if someone could clarify on this
16 REPLIES 16

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
This is expected according to the specs afaik. Add a join after it…

vram
Champ in-the-making
Champ in-the-making
Thanks..

Even in the following case where I use a parallel gateway and two ends, I find the execution in another path also halting when one stop is encountered. Is this also the expected behavior?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Hmmm… You have me doubting now. Not only about this latest question, but even the previous one. Currently reading the specs of the end event (10.4.3)…

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Funny thing is that the behaviour you see is the opposite of http://forums.activiti.org/en/viewtopic.php?f=6&t=3969
This post describes the behaviour I was (kind of) expecting, therefor you made me doubt.

So it alsmost seems that the default behaviour of an end event chaged to a terminate end event… This is I think, not good. Will ping the devs…

frederikherema1
Star Contributor
Star Contributor
I validated this agains the current trunk-build, and BOTH service-tasks are executed after a parallel fork before the process actually ends:



08:58:42,036 FIN  | ConcurrentExecution[6] takes transition (fork)–>(service1)  [org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake]
08:58:42,036 FIN  | ConcurrentExecution[6] executes Activity(service1): org.activiti.engine.impl.bpmn.helper.ClassDelegate  [org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute]
08:58:42,042 FIN  | Leaving activity 'service1'  [org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior]
08:58:42,043 FIN  | ConcurrentExecution[6] takes transition (service1)–flow2–>(end1)  [org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake]
08:58:42,043 FIN  | ConcurrentExecution[6] executes Activity(end1): org.activiti.engine.impl.bpmn.behavior.NoneEndEventActivityBehavior  [org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute]
08:58:42,103 FIN  | ProcessInstance[4] takes transition (fork)–>(service2)  [org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake]
08:58:42,103 FIN  | ProcessInstance[4] executes Activity(service2): org.activiti.engine.impl.bpmn.helper.ClassDelegate  [org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute]
08:58:42,104 FIN  | Leaving activity 'service2'  [org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior]
08:58:42,104 FIN  | ProcessInstance[4] takes transition (service2)–flow3–>(end2)  [org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake]
08:58:42,104 FIN  | ProcessInstance[4] executes Activity(end2): org.activiti.engine.impl.bpmn.behavior.NoneEndEventActivityBehavior  [org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute]
08:58:42

ConcurrentExecution[6] executes Activity(service1)
ConcurrentExecution[6] executes Activity(end1): org.activiti.engine.impl.bpmn.behavior.NoneEndEventActivityBehavior 
ProcessInstance[4] executes Activity(service2)
ConcurrentExecution[6] executes Activity(end1): org.activiti.engine.impl.bpmn.behavior.NoneEndEventActivityBehavior 
destroying ProcessInstance[4]  [org.activiti.engine.impl.persistence.entity.ExecutionEntity]

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Thanks Frederik… Then I'm not going crazy. Have no Activiti at hand the comming days to test myself

frederikherema1
Star Contributor
Star Contributor
Ronald, don't tell me you're looking in the activiti-forum while on holiday, right? Smiley Wink

vram
Champ in-the-making
Champ in-the-making
Thanks Ronald and frederikheremans for helping out.

In this case, for the first figure, would the 'Service Task' (that joins both the flows) wait for both the flows to be complete and then execute only once or would it be executed twice?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
twice I would suspect and if that is not ok, then put a parallel-join after it. If you want to force it to be twice, put an inclusive gateway behind it.