Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 6 Controlling Flow : Gateways

Gateways
Gateways are a control mechanism for the sequence flow in the process. They are represented by a diamond:
Although the gateway resembles a decision box in a flow chart, gateways provide a variety of behaviors besides conditional decisions.
As shown on the Properties view of a gateway, these are the different types of gateway that you can create.
Order of Flow Evaluation
When a gateway has multiple sequence flow output, you can specify the order in which the outgoing sequence flow is processed. You can view the current order by highlighting one of the sequence flows and placing the pointer over the outline numbers that appear. For example:
This is especially significant for evaluating the conditions on sequence flows attached to exclusive gateways. For example:
In this case, the > 500 sequence flow is processed first. Assuming that the JavaScript conditions are set up as their labels imply, if the value is greater than 500, User Task 2 will be executed. The > 1000 sequence flow and User Task 3 will never be reached.
To change the order of evaluation, drag the numbers that appear on the sequence flows. For example, dragging the 2 and dropping it onto the 1 changes the order of sequence flow evaluation as follows:
Exclusive (XOR)
In an exclusive gateway, there are several paths through which the process can continue, but only one is actually chosen when the process is run. There are two types of exclusive gateway:
Exclusive (Data)  The sequence flow is chosen based on an expression using data from the process. This type of gateway is indicated in the process as follows:
Exclusive (Event)  The sequence flow is chosen based upon an external event (for example, a JMS message). This type of gateway is indicated in the process as follows:
The following shows a typical XOR (data) gateway:
There is one uncontrolled input sequence flow to the gateway, and conditional and default output sequence flows.
An XOR (data) gateway displays an X as a visual cue to the gateway type. However, because the display of the X is not required by BPMN, you can disable the display of the X in the Property view for the gateway by deselecting Show "X" Marker.
Inclusive (OR)
An inclusive gateway looks like this:
In an inclusive gateway used for branching, each output Sequence Flow is independently evaluated according to an expression. This means that anywhere from zero to the maximum output sequence flows can be taken. In practice, you should either provide a default sequence flow or ensure that at least one sequence flow evaluates to True.
When used to merge flow, any upstream sequence flows are synchronized, but the gateway does not wait for all sequence flows.
Complex
A complex gateway is used to fork or merge depending on how an expression evaluates. When used as a decision, the expression determines which of the outgoing sequence flow are chosen for the process to continue.
When used to merge flow, the expression determines which of the incoming sequence flows is required for the process to continue. This type of gateway is indicated in the process as follows:
Join Configuration
Although TIBCO Business Studio does not provide for entering an expression on a complex gateway, there is a Join Configuration section in the Properties view. This allows you to specify how many incoming sequence flows are received before flow continues. For example:
 
There are three sequence flows going into the complex gateway. On the properties of the gateway, the Continue When ’n’ Parallel Flows Arrive join type is selected. The parallel gate way is specified indicating that this complex gateway is handling an earlier parallel split (named Split1), and that flow should continue when only one of the sequence flows reaches the complex gateway.
Parallel (AND)
A parallel gateway is used to fork or merge several parallel paths (synchronization). When several sequence flows enter a parallel gateway, the process flow waits until all arrive at the gateway before continuing. This type of gateway is indicated in the process as follows:

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved