Problem with xor gateway

The xor gateway is not behaving as expected, an example with optional approvals, where one of the approvers validate the process, the flow should continue, but this not happening, follows a image with the model, on my tests when one of aproval activities is executed the other aproval activity still open. sample

Hello angelobochini,

Thanks for the image of the diagram.
Just a note about the modeling : if you have an AND opening gateway, you should have also an AND gateway instead of the XOR gateway. That explains why your expected behaviour doesn’t work.

By the way, if you want some parallel approvals, I would suggest you to have a look to the the multi-instanciation feature.
More information here about the iteration mechanism :
http://documentation.bonitasoft.com/iteration

Hopefully it helps.

Best regards,
LL

Hi Again,

I just tested you first diagram (with both AND and XOR gateway), and just made some changes like as following :
http://dl.free.fr/kQ3pudzif
It works fine on my side, and we can see that the second step is aborted by the system :
http://dl.free.fr/kukhu2mYG

I used a 6.3.0 version, but there should be no issue with previous version of 6.X.
Just give it a try on your side and keep us informed.

Regards,
LL

I just created a small process example with a And and a Xor gates. It is available in the Projects section:

http://community.bonitasoft.com/project/xor-example

Could you please tell me if it works ?

Hi, according with BPMN specification, once the token reach the parallel gataway it is cloned in two and this two tokens still remain openend even if one of two reach the XOR gateway. It is up to the designer make a diagram in order to be sure that only one incoming token will reach the exclusive gateway. Your diagram is not correct. you can re-model it using for example a multi-instatiated task with a check out condition or a sub-process with terminate end event on both parallel path or whatever other solution you can adopt in order to avoid to have this indeterminate situation.
Hope I am clear enough.
Ciao
Domenico

Hi Domenico

I searched on the BPM specification document of omg.org in “http://www.omg.org/spec/BPMN/2.0/PDF” and not found the definition "… once the token reach the parallel gateway it is cloned in two and this two tokens still remain opened even if one of two reach the XOR gateway … " could you tell me the page where is this definition?

In workflow patterns document “http://www.omg.org/bpmn/Documents/Notations_and_Workflow_Patterns.pdf” exists a section on “CANCELLATION PATTERNS” (page 22 figure 45) that brings some samples of how the execution of a activity may cancel another in parallel, using a signal. But I think that this is not implemented on Bonita.

The model process that I includes as an example, is a simplification of the problem, not the real process, on the actual processes the parallel activities are not the same, then the multi-instatiated option can not be applied.

The use of parallel processes will be the last option, because dozens of processes will have to be refactory.

Hi Angelo

  1. BPMN Method and Style- Bruce Silver “An AND Gateway may only be used to join paths that are unconditionally parallel. Typically this occurs only when the paths were originally the result of a parallel split…”
  2. BPMN Real life: figure 2.9: “the token is generated and then cloned as always in the AND split. As soon as we finish preparing the salade, the token passes through the XOR merge and ‘eat meal’ executes. Five minutes later, “cook pasta” also completes. Its token passes through the XOR merge and ‘eat meal’ executes again! That’s not the behavior we wanted”.

Cancellation can be achived by timer, exception (as reported in your picture), messages catch event and signal catch event. If you use these events in a boundary way you will obtain the cancellation of the task.

I repeat: in your example a mult-iinstantiated approval task with the right join condition should solve your problem.
Hope that now I am more clear.
Regards.

The two approvals are not mandatory, the execution of one is enough. (Its one or other…)

In the business model there are two approvers and either may execute, for monitoring reasons we individualized activities. but if one is executed the other is aborted.

On version 5.10 and previous the behavior is as described above

How I can do this now on version 6.x?

Follow other sample more simplist, maybe you send me a sample process model with xor gateway, Thanks in advance.
sample2

you should also set a default gateway (it adds a small line on the transition arrow)

If there is only one output on the gateway it should be the default, but anyway I’ve also tried and did not work.

have you checked the new answer above with the diagram tested ok with your inputs ?
Please have a look. As I said it works fine, you will need to tune the diagram accordingly.

I checked, tested and commented on other answer.

I just tested you first diagram (with both AND and XOR gateway), and just made some changes like as following : http://dl.free.fr/kQ3pudzif

— I try with your model and the error happened again…

It works fine on my side, and we can see that the second step is aborted by the system : http://dl.free.fr/kukhu2mYG

— The second activity was aborted only because you executed the third activity that sent the process to an** Terminate End Event** that aborted any activities that were open… (Run your process and execute only one of this activities… (Etape1 or Etape2) the other should be closed on this moment… )

I used a 6.3.0 version, but there should be no issue with previous version of 6.X. Just give it a try on your side and keep us informed.

—I tried version 6.3 and the error happened again…

  1. I try with this model and the error happened again…

  2. The second activity was aborted (on your case) only because you executed the third activity that snet the process to an Terminate End Event that aborted any activities that were open… (Run your process and execute only one of this activities… (Etape1 or Etape2) the other should be closed on this moment…, but it is not)

  3. I tried version 6.3 and the error happened again…

Hi Angelo,

It appears that in 6.x version, the BPMN 2.0 compliance has been improved compared to version 5.
The previous diagram you were using with AND + XOR gateways, worked in Version 5, as you described it.
Today, and after analysing this diagram, it is not fully BPMN 2.0 compliant. To achieve exactly the same behaviour I would suggest following diagrams with Messages events :
http://dl.free.fr/pxMGDRxIb

Hopefully it helps.

Additionaly, and as stated before, if both Approval-A and Approval-B are two identical tasks, and only actors change, I would recommand to use the iteration :
http://documentation.bonitasoft.com/iteration

BRs,
LL

Hi Antoine

I execute your model, below step by step

User

  • Start the process

Portal

  • Show 1º activity (Disclaimer)

User
-Execute 1º activity (Disclaimer)

Portal

  • Show activities (Step1,Step2,Step3)

User

  • Execute activity Step1

Portal

  • Show activities (Step2,Step3 and Confirmation)

The activities Step2,Step3 should not have been aborted?

when you do the confirmation step, the other tasks of the case are aborted. The only issue with this design is that you might have a confirmation step for each step1, step2, and step3, if they are done before the first available confirmation.

If you want to avoid this behaviour, you will have to use call to actions, etc…

I understand, if I execute the confirmation step, the terminate event kill all others activities.

Can you confirm the information below?

  1. The behavior of the XOR gateway (on version 6.x) changed compared to what it was (on version 5.x).

  2. When triggered by any one of the entries XOR gateway triggers the output, but WITHOUT aborting other activities connect with XOR gateway.

I am not a V5 user, I really started with V6. However, after making trials, yes, the other activities are not killed by the XOR gate. Do you think this is a bas behaviour regarding BPMN2 spec ?