Скачиваний:
25
Добавлен:
28.01.2021
Размер:
7.15 Mб
Скачать

Table 10.126 – Instance attributes related to the Complex Gateway

Attribute Name

Description/Usage

 

 

activationCount: integer

Refers at runtime to the number of tokens that are present on an incoming

 

Sequence Flow of the Complex Gateway.

 

 

waitingForStart: boolean = true

Represents the internal state of the Complex Gateway. It is either waiting

 

for start (=true) or waiting for reset (=false).

 

 

10.6.6 Event-Based Gateway

The Event-Based Gateway represents a branching point in the Process where the alternative paths that follow the Gateway are based on Events that occur, rather than the evaluation of Expressions using Process data (as with an Exclusive or Inclusive Gateway). A specific Event, usually the receipt of a Message, determines the path that will be taken. Basically, the decision is made by another Participant, based on data that is not visible to Process, thus, requiring the use of the Event-Based Gateway.

For example, if a company is waiting for a response from a customer they will perform one set of Activities if the customer responds “Yes” and another set of Activities if the customer responds “No.” The customer’s response determines which path is taken. The identity of the Message determines which path is taken. That is, the “Yes” Message and the “No” Message are different Messagesi.e., they are not the same Message with different values within a property of the Message. The receipt of the Message can be modeled with an Intermediate Event with a

Message trigger or a Receive Task. In addition to Messages, other triggers for Intermediate Events can be used, such as Timers.

The Event Gateway shares the same basic shape of the Gateways, a diamond, with a marker placed within the diamond to indicate variations of the Gateway.

An Event Gateway is a diamond that MUST be drawn with a single thin line.

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

The marker for the Event Gateway MUST look like a catch Multiple Intermediate Event (see Figure 10.115).

Figure 10.115 – Event-Based Gateway

Unlike other Gateways, the behavior of the Event Gateway is determined by a configuration of elements, rather than the single Gateway.

An Event Gateway MUST have two or more outgoing Sequence Flows.

The outgoing Sequence Flows of the Event Gateway MUST NOT have a conditionExpression.

296

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

The objects that are on the target end of the Gateway’s outgoing Sequence Flows are part of the configuration of the

Gateway.

Event-Based Gateways are configured by having outgoing Sequence Flows target an Intermediate Event or a Receive Task in any combination (see Figure 10.116 and Figure 10.117) except that:

If Message Intermediate Events are used in the configuration, then Receive Tasks MUST NOT be used in that configuration and vice versa.

Receive Tasks used in an Event Gateway configuration MUST NOT have any attached

Intermediate Events.

Only the following Intermediate Event triggers are valid: Message, Signal, Timer, Conditional, and Multiple (which can only include the previous triggers). Thus, the following Intermediate Event triggers are not valid: Error, Cancel, Compensation, and Link.

Target elements in an Event Gateway configuration MUST NOT have any additional incoming Sequence Flows (other than that from the Event Gateway).

Message

1

Request

Response

Message

2

1 Day

Figure 10.116 – An Event-Based Gateway example using Message Intermediate Events

Receive

Message 1

Request

Receive

Reponse

Message 2

1 Day

Figure 10.117 – An Event-Based Gateway example using Receive Tasks

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

297

When the first Event in the Event Gateway configuration is triggered, then the path that follows that Event will used (a token will be sent down the Event’s outgoing Sequence Flows). All the remaining paths of the Event Gateway configuration will no longer be valid. Basically, the Event Gateway configuration is a race condition where the first Event that is triggered wins.

There are variations of the Event Gateway that can be used at the start of the Process. The behavior and marker of the Gateway will change.

Event Gateways can be used to instantiate a Process. By default the Gateway’s instantiate attribute is false, but if set to true, then the Process is instantiated when the first Event of the Gateway’s configuration is triggered.

If the Event Gateway’s instantiate attribute is set to true, then the marker for the Event Gateway looks like a Multiple Start Event (see Figure 10.118).

Figure 10.118 – Exclusive Event-Based Gateway to start a Process

In order for an Event Gateway to instantiate a Process, it MUST not have any incoming Sequence Flows.

In some situations a modeler might want the Process to be instantiated by one of a set of Messages while still requiring all of the Messages for the working of the same Process instance. To handle this, there is another variation of the Event Gateway.

If the Event Gateway’s instantiate attribute is set to true and the eventGatewayType attribute is set to

Parallel, then the marker for the Event Gateway looks like a Parallel Multiple Start Event

(see Figure 10.119).

The Event Gateway’s instantiate attribute MUST be set to true in order for the eventGatewayType attribute to be set to Parallel (i.e., for Event Gateway’s that do not instantiate the Process MUST be Exclusive—a standard Parallel Gateway can be used to include parallel Events in the middle of a Process).

Figure 10.119 – Parallel Event-Based Gateway to start a Process

The Parallel Event Gateway is also a type of race condition. In this case, however, when the first Event is triggered and the Process is instantiated, the other Events of the Gateway configuration are not disabled. The other Events are still waiting and are expected to be triggered before the Process can (normally) complete. In this case, the Messages that trigger the Events of the Gateway configuration MUST share the same correlation information.

298

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

Figure 10.120 – Event-Based Gateway class diagram

The Event-Based Gateway element inherits the attributes and model associations of Gateway (see Table 8.46). Table 10.127 presents the additional attributes and model associations of the Event-Based Gateway element.

Table 10.127 – EventBasedGateway Attributes & Model Associations

Attribute Name

Description/Usage

 

 

instantiate: boolean = false

When true, receipt of one of the Events will instantiate the Process

 

instance.

 

 

eventGatewayType:

The eventGatewayType determines the behavior of the Gateway when

EventGatewayType = Exclusive

used to instantiate a Process (as described above).

{ Exclusive | Parallel }

The attribute can only be set to parallel when the instantiate attribute is set

 

 

to true.

 

 

Event-Based Gateways can be used at the start of a Process, without having to be a target of Sequence Flows. There can be multiple such Event-Based Gateways at the start of a Process. Ordinary Start Events and EventBased Gateways can be used together.

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

299