</xsd:complexContent> </xsd:complexType>

10.6 Gateways

Gateways are used to control how Sequence Flows interact as they converge and diverge within a Process. If the flow does not need to be controlled, then a Gateway is not needed. The term “Gateway” implies that there is a gating mechanism that either allows or disallows passage through the Gateway. As tokens arrive at a Gateway they can be merged together on input and/or split apart on output as the Gateway mechanisms are invoked.

A Gateway is a diamond, which has been used in many flow chart notations for exclusive branching and is familiar to most modelers.

A Gateway is a diamond that MUST be drawn with a single thin line (see Figure 10.102).

Figure 10.102 – A Gateway

The use of text, color, size, and lines for a Gateway MUST follow the rules defined in “Use of Text, Color, Size, and Lines in a Diagram” on page 39 with the exception that:

Gateways, like Activities, are capable of consuming or generating additional tokens, effectively controlling the execution semantics of a given Process. The main difference is that Gateways do not represent ‘work’ being done and they are considered to have zero effect on the operational measures of the Process being executed (cost, time, etc.).

Gateways can define all the types of Business Process Sequence Flow behavior: Decisions/branching (exclusive, inclusive, and complex), merging, forking, and joining. Thus, while the diamond has been used traditionally for exclusive decisions, BPMN extends the behavior of the diamonds to reflect any type of Sequence Flow control. Each type of Gateway will have an internal indicator or marker to show the type of Gateway that is being used (see Figure 10.103).

286

Business Process Model and Notation (BPMN), v2.0.2

Exclusive

or

X

 

Event-Based

 

 

Parallel

Event-Based

Inclusive

Complex

Parallel

Figure 10.103 – The Different types of Gateways

The Gateway controls the flow of both diverging and converging Sequence Flows. That is, a single Gateway could have multiple input and multiple output flows. Modelers and modeling tools might want to enforce a best practice of a Gateway only performing one of these functions. Thus, it would take two sequential Gateways to first converge and then to diverge the Sequence Flows.

Business Process Model and Notation (BPMN), v2.0.2

287

Figure 10.104 – Gateway class diagram

Gateways are described in this sub clause on an abstract level. The execution semantics of Gateways is detailed on page 434.

10.6.1 Sequence Flow Considerations

NOTE: Although the shape of a Gateway is a diamond, it is not a requirement that incoming and outgoing Sequence Flows MUST connect to the corners of the diamond. Sequence Flows can connect to any position on the boundary of the Gateway shape.

This sub clause applies to all Gateways. Additional Sequence Flow Connection rules are specified for each type of Gateway in the sub clauses below.

A Gateway MAY be a target for a Sequence Flow. It can have zero (0), one (1), or more incoming

Sequence Flows.

If the Gateway does not have an incoming Sequence Flow, and there is no Start Event for the Process, then the Gateway’s divergence behavior, depending on the type of Gateway (see below), SHALL be performed when the Process is instantiated.

288

Business Process Model and Notation (BPMN), v2.0.2

A Gateway MAY be a source of a Sequence Flow; it can have zero, one, or more outgoing Sequence Flows.

A Gateway MUST have either multiple incoming Sequence Flows or multiple outgoing Sequence Flows (i.e., it MUST merge or split the flow).

A Gateway with a gatewayDirection of unspecified MAY have both multiple incoming and outgoing Sequence Flows.

A Gateway with a gatewayDirection of mixed MUST have both multiple incoming and outgoing

Sequence Flows.

A Gateway with a gatewayDirection of converging MUST have multiple incoming Sequence Flows, but MUST NOT have multiple outgoing Sequence Flows.

A Gateway with a gatewayDirection of diverging MUST have multiple outgoing Sequence Flows, but MUST NOT have multiple incoming Sequence Flows.

10.6.2 Exclusive Gateway

A diverging Exclusive Gateway (Decision) is used to create alternative paths within a Process flow. This is basically the “diversion point in the road” for a Process. For a given instance of the Process, only one of the paths can be taken.

A Decision can be thought of as a question that is asked at a particular point in the Process. The question has a defined set of alternative answers. Each answer is associated with a condition Expression that is associated with a Gateway’s outgoing Sequence Flows.

The Exclusive Gateway MAY use a marker that is shaped like an “X” and is placed within the Gateway diamond (see Figure 10.106) to distinguish it from other Gateways. This marker is NOT REQUIRED (see Figure 10.105).

A diagram SHOULD be consistent in the use of the “X” internal indicator. That is, a diagram SHOULD NOT have some Gateways with an indicator and other Gateways without an indicator.

Condition 1

Condition 2

Default

Figure 10.105 – An Exclusive Data-Based Decision (Gateway) Example without the Internal Indicator

Business Process Model and Notation (BPMN), v2.0.2

289

Condition 1

Condition 2

Default

Figure 10.106 – A Data-Based Exclusive Decision (Gateway) Example with the Internal Indicator

NOTE: as a modeling preference, the Exclusive Gateways shown in examples within this document will be shown without the internal indicator.

A default path can optionally be identified, to be taken in the event that none of the conditional Expressions evaluate to true. If a default path is not specified and the Process is executed such that none of the conditional Expressions evaluates to true, a runtime exception occurs.

A converging Exclusive Gateway is used to merge alternative paths. Each incoming Sequence Flow token is routed to the outgoing Sequence Flow without synchronization.

Figure 10.107 – Exclusive Gateway class diagram

The Exclusive Gateway element inherits the attributes and model associations of Gateway (see Table 8.46). Table 10.123 presents the additional attributes and model associations of the Exclusive Gateway element.

290

Business Process Model and Notation (BPMN), v2.0.2

Тут вы можете оставить комментарий к выбранному абзацу или сообщить об ошибке.

Оставленные комментарии видны всем.