cancel
Showing results for 
Search instead for 
Did you mean: 

AND and OR for parallel tasks

aurelienpel
Champ in-the-making
Champ in-the-making
Hello,

I am testing different kinds of workflows, and I have a problem when I have parallel tasks.
For example, I created a workflow with 2 parallel gateways, a first one for the fork and the second one for joining. This one is ok, I can only go to the task after the parallel gateway, only when the 2 incoming sequence flows are joined. The first one will wait for the second one.
In my mind, it is like : "you can go to task 3 ONLY if you have task 1 AND task 2". This is a logic AND.

What I would like is a logic OR, so "you can go to task 3 ONLY if you have task 1 OR task 2" , so you don't need both of them. When the first one arrives at the gateway, the second one is like ""destroyed"", even if you still have other tasks. I thought about the inclusive gateway, but I don't have the expected result, maybe when I created the workflow I forgot smtg. So my real question is , for a logic AND, do you use an inclusive gateway, or is there a better way ?

Thanks a lot for your help,

Regards

Aurelien
4 REPLIES 4

aurelienpel
Champ in-the-making
Champ in-the-making
here is my example.
What I would like is, to go to "afternoon" task, I don't need to wait for "coffee" and "work" completed, only one is necessary, and the second one is like destroyed. But I don't know which gateway allows that. An exclusive GT will let a task continue, but the second one will be able to continue also .. Or, do I have to add a particular condition ?

Thanks !

Aurelien

tstephen
Champ on-the-rise
Champ on-the-rise
Hi Aurelien,

As you have found both Exclusive and Inclusive  (previously known as OR) Merges will fire repeatedly each time one of the incoming flows is received. The difference is that on the downstream side the Exclusive one will select just one out-going sequence flow. In your case you only have one outgoing flow so they will behave the same.

You need an Exclusive Event-Based gateway after 'Morning' this will allow both Hello and Meeting as options and whichever occurs first will cause the other to be destroyed. Downstream you will need an Exclusive / Inclusive (not Parallel) merge before 'Afternoon'.

There is an example in the user guide here: http://activiti.org/userguide/index.html#bpmnEventbasedGateway

All the best,
Tim   

aurelienpel
Champ in-the-making
Champ in-the-making
Thanks a lot for your help.

According to your help and the link of the user guide, I modified my workflow. You can find it attached.

However, it seems like I forgot something because when I complete the task 'morning', I stay at the gateway, but don't go to the 2 following tasks 'meeting and 'hello'. Did I forget a condition ? Maybe on the sequence flows, but I didn't see one in the example of the user guide.
When I retrieve all tasks for this instance, I can see that 'morning' is completed, and visible in historic, but the 2 following are not created..

Also, in your opinion, is it a correct workflow for my case ? To remind it, I would like to do a OR, so go to the task 'night' only by completing either 'coffee' or 'work' . the other task will be like destroyed.

Regards,

Aurelien

jbarrez
Star Contributor
Star Contributor
If i read your process correctly, after the 'morning' task, you will have two intermediateCatchEvents active. Your process is waiting in them to continue.