cancel
Showing results for 
Search instead for 
Did you mean: 

Exclusive join of forked parallel gateway executions

gergelydombi
Champ in-the-making
Champ in-the-making
Hi,

I want to implement the following behaviour:

        |—– TASK APPROVE ——|
TASK 1 -+                         +———- END
        |——TASK CANCEL ——-|
TASK APPROVE is a human task dedicated to the actor group APPROVER
TASK CANCEL is a human task dedicated to a different actor

There is a parallel gateway between these tasks and the initial TASK 1 which forks the
process into two executions.

There is another parallel gateway that joins these executions.

Basically I want to continue from this gateway whenever the FIRST token arrives
(either from the CANCEL or the APPROVE path).

I could not find built in BPMN2.0 construct for this.

My ideas:

1) Implement a boundary event attached to TASK APPROVE to catch a terminateEvent from the TASK CANCEL path (it seems like activiti currently not supports only timer and error based boundary)
Is it at all possible to throw an error event to influence control flow? At least it does not sounds like a good flow design. Or is it consiedred the way to go in bpmn?

2) Implement a TaskListener in TASK CANCEL to programmatically complete() the TASK APPROVE
with a special transition that represent the cancellation

Does someone have any more idea on this?
4 REPLIES 4

gergelydombi
Champ in-the-making
Champ in-the-making
any ideas?

jcosano
Champ in-the-making
Champ in-the-making
Maybe you can define this structure:

task approve –> serviceTask 1
task cancel –> serviceTask 1

ServiceTask 1 –> End

And service task, search and complete the open task, maybe you need add some variable to know which is the correct complete task…

Maybe is needed have a final join after service task…

yangyang_qian
Champ in-the-making
Champ in-the-making
Hm, maybe I'm not understanding your process … but why not just change the second join to an exclusive gate?

        |—– TASK APPROVE ——|
TASK 1 -+                         [X]———- END
        |——TASK CANCEL ——-|

This way, whichever path is completed first will reach END first …

bojiang
Champ in-the-making
Champ in-the-making
Hm, maybe I'm not understanding your process … but why not just change the second join to an exclusive gate?

        |—– TASK APPROVE ——|
TASK 1 -+                         [X]———- END
        |——TASK CANCEL ——-|

This way, whichever path is completed first will reach END first …

I tried this solution. Two task instances will be created, and after complete one of them,  the process instance is not ended. After the other taskinstance is completed, the process instance is ended.