Goals of this lesson

- Usage of exclusive gateways

How-to

Model 3.a explains how to use exclusive gateways for a simulation. Contrary to parallel gateways a branching exclusive gateway needs a condition on every outgoing sequence flow depending on (a) process variable(s). During the simulation the conditions on the outgoing edges will be evaluated to determine exactly one edge as the next path element. You have to ensure that the conditions will determine exactly one sequence flow, otherwise (two or more edges meet the conditions) the simulation results will be useless due to this modeling fault.

Please refer to section Variables for a description of how to set up variables and conditions.

Figure 1: Model 3a - Exclusive Gateway / IYOPRO-Link |

Approach

Depending on our assignment of variables and conditions from the lessons Assigning Process Variables and Assigning Gateway Conditions, our variables and conditions look like this:

- For the model above we will define the variables x and y at the first activity
- x=1; which defines the variable x with a value of 1
- y=1; which defines the variable y with a value of 1
- At the second activity We will now increment x by one and define the new variable z that takes its value from y
- x=x+1; which increments x's value by 1
- z=y; which defines a new variable z that will be given y's value
- Our variables have now these values: x = 2, y = 1, z = 1
- Now declare the edge's conditions behind the branching exclusive gateway:
- Upper edge: x < y
- Bottom edge: x > y

Explanation

This configuration is quite static and always leads to the result, that the bottom sequence flow is being followed, and therefore the activity "Sub process 1" will never be executed. Simply simulate the model with this configuration and you will notice that the activity "Sub process 1" does not contain any statistical information.

Attention

- None of the edges' expressions test the equality of x and y.
- This is a common error in this type of condition.
- If x and y are equal, the gateway will not fire.
- It will not pass any token, which means that the process instance is trapped at the gateway.
- So, we will need to check for equality.
- Either by adding a third edge that checks for x == y
- or by extending one of our already existing edges' condition to x >= y or x <= y.
- Note that the latter can only be done for only one (edge's) condition, because we must impose the exclusive restriction (an exclusive branching gateway must pass exactly one token!)