Table 11.8 – Use of End Events in Choreography

Multiple

No. Since there are no valid End Event Results (Terminate doesn’t count) in

 

Choreography, there cannot be multiple of them.

 

 

Terminate

Yes. However, there would be no specific ability to terminate the

 

Choreography, since there is no controlling system. In this case, all

 

Participants in the Choreography would understand that when the Terminate

 

End Event is reached (actually when the Message that precedes it occurs),

 

then no further messages will be expected in the Choreography, even if there

 

were parallel paths. The use of the Terminate End Event really only works

 

when there are only two Participants. If there are more than two Participants,

 

then any Participant that was not involved in the last Choreography Task would

 

not necessarily know that the Terminate End Event had been reached.

 

 

11.7 Gateways

In an Orchestration Process, Gateways are used to create alternative and/or parallel paths for that Process. Choreography has the same requirement of alternative and parallel paths. That is, interactions between Participants can happen in sequence, in parallel, or through exclusive selection. While the paths of Choreography follow the same basic patterns as that of an Orchestration Process, the lack of a central mechanism to maintain data visibility, and that there is no central evaluation, there are constraints as to how the Gateways are used in conjunction with the Choreography Activities that precede and follow the Gateways. These constraints are an extension of the basic sequencing constraints that was defined on page 335. The six (6) sub clauses that follow will define how the types of Gateways are used in

Choreography.

11.7.1 Exclusive Gateway

Exclusive Gateways (Decisions) are used to create alternative paths within a Process or a Choreography. For details of how Exclusive Gateways are used within an Orchestration Process see page 289.

Exclusive Gateways are used in Choreography, but they are constrained by the lack of a central mechanism to store the data that will be used in the Condition expressions of the Gateway’s outgoing Sequence Flows. Choreographies MAY contain natural language descriptions of the Gateway’s Conditions to document the alternative paths of the Choreography (e.g., “large orders” will go down one path while “small orders” will go down another path), but such Choreographies would be underspecified and would not be enforceable. To create an enforceable

Choreography, the Gateway Conditions MUST be formal Condition Expressions. However:

The data used for Gateway Conditions MUST have been in a Message that was sent prior to (upstream from) the Gateway.

More specifically, all Participants that are directly affected by the Gateway MUST have either sent or received the Message(s) that contained the data used in the Conditions.

Furthermore, all these Participants MUST have the same understanding of the data. That is, the actual values of the data cannot selectively change after a Participant has seen a Message. Changes to data during the course of the Choreography MUST be visible to all the Participants affected by the

Gateway.

These constraints ensure that the Participants in the Choreography understand the basis (the actual value of the data) for the decision behind the Gateway.

344

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

One (1) or more Participants will actually “control” the Gateway decision; that is, these Participants make the decision through the internal Orchestration Processes. The decision is manifested by the particular Message that occurs in the

Choreography (after the Gateway). This Message is the initiating Message of a Choreography Activity that follows the Gateway. Thus, only the Participants that are the initiators of the Messages that follow the Gateway are the ones that control the decision. This means that:

The initiating Participants of the Choreography Activities that follow the Gateway MUST have sent or received the Message that provided the data upon which the decision is made.

The Message that provides the data for the Gateway MAY be in any Choreography Activity prior to the Gateway (i.e., it does not have to immediately precede Gateway).

 

 

P arti ci pan t A

 

Y es

C hore ograp hy

 

 

Ta sk 2

P artic ipan t A

 

P arti ci pan t B

C ho reogra phy

D ecision?

 

 

 

T as k 1

 

 

 

 

P artic ipa nt C

P artic ipan t B

 

 

N o

C hore ograp hy

 

Ta sk 3

 

 

 

 

 

P arti ci pan t B

Figure 11.34 – An example of the Exclusive Gateway

Figure 11.35 shows the Collaboration that demonstrates how the above Choreography that includes an Exclusive Gateway can be enforced.

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

345

 

Yes

Receive

 

A

 

Message

 

Decision?

 

 

Participant

 

 

Send

 

 

Message

 

 

 

 

 

 

No

 

 

 

M1

M2

 

 

Yes

Send

 

 

Message

 

 

 

 

B

 

 

 

Participant

Decision?

 

 

R eceive

 

 

Message

 

 

 

 

 

 

 

No

Send

 

 

Message

 

 

 

M3

 

Yes

 

 

C

Decision?

 

 

Participant

 

 

 

 

Receive

 

 

 

 

 

No

Message

 

 

 

Figure 11.35 – The relationship of Choreography Activity Participants across the sides of the Exclusive Gateway shown through a Collaboration

Usually, the initiators for the Choreography Activities that follow the Gateway will be the same Participant. That is, there is only one Participant controlling the decision. Often, the receivers of the initiating Message for those Choreography Activities will be the same Participant. However, it is possible that there could be different Participants receiving the initiating Message for each Choreography Activity (see Figure 11.36).

346

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

 

Participant A

Yes

Choreography

 

Task 2

Participant A

Participant B

Decision?

 

Choreography

 

Task 1

 

Participant B

Participant A

 

Choreography

No

Task 3

 

Participant C

Figure 11.36 – Different Receiving Choreography Activity Participants on the output sides of the Exclusive Gateway

This configuration can only be valid if all the Participants in the Choreography Activities that follow the Gateway have seen the data upon which the decision is made. If either “Participant B” or “Participant C” had not sent or received a Message with the appropriate data, then that Participant would not be able to know if they are suppose to receive a Message at that point in the Choreography. There is also the assumption that the value of the data is consistent from the point of view of all Participants.

Figure 11.37 displays the corresponding Collaboration view of the above Choreography Exclusive Gateway configuration.

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

347

 

 

Yes

Send

A

 

 

Message

Decision?

 

 

Participant

 

 

Send

 

 

Message

 

 

 

Send

 

 

No

 

 

Message

 

 

M1

M2

M3

Participant B

Participant C

Yes

Recieve

 

Message

Decision?

Receive

Message

No

Yes

Decision?

Recieve

No Message

Figure 11.37 – The corresponding Collaboration view of the above

Choreography Exclusive Gateway configuration

The REQUIRED execution behavior of the Gateway and associated Choreography Activities are enforced through the Business Processes of the Participants as follows:

Each Choreography Activity and the Sequence Flow connections are reflected in each Participant

Process.

The Gateway is reflected in the Process of each Participant Process that is an initiator of Choreography Activities that follow the Gateway.

For the receivers in Choreography Activities that follow the Gateway, an Event-Based Gateway is used to consume the associated Message (sent as an outcome of the Gateway). When a Participant is the receiver of more than one of the alternative Messages, the corresponding receives follow the Event-Based Gateway.

348

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