The following figure shows the mapping of a BPMN Sub-Process with an Event Sub-Process. (Event Sub- Processes could also be added to a top-level Process, in which case their mapping extends correspondingly.)

[

S ubp ro ce ss

]

 

< scop e>

 

 

G

=

[G]

 

< /sco pe>

Note that in case of multiple Event Sub-Processes, there would be multiple WS-BPEL handlers.

Mapping of Event Sub-Processes

Note that if a Sub-Process contains multiple Event Sub-Processes, all become handlers of the associated WSBPEL scope, ordered and grouped as specified by WS-BPEL.

Non-interrupting Message Event Sub-Processes are mapped to WS-BPEL event handlers as follows.

[

Message Handler

]

 

<eventHandlers>

 

 

 

<onE vent partnerLink="[e-operation-interface]"

 

G

=

operation="[e-operation]">

 

<scope >[G]</scope>

 

 

 

 

 

e

 

 

</onEvent>

 

 

</eventHandlers>

Timer Event Sub-Processes are mapped to WS-BPEL event handlers as follows.

[

Timeout Handler

]

 

 

<eventHandle rs>

 

 

 

 

<onAlarm>[timer-spec]

 

G

=

<scope>[G]</scope>

e

 

 

</eventHa</onAlarmndl>ers>

Error Event Sub-Processes are mapped to WS-BPEL fault handlers as follows.

 

Error H a ndle r

 

 

 

< faul tH an dle rs>

 

 

 

 

 

 

 

<c atc h fa ult N am e=" [e-fa ult ] ">

[ e

 

 

 

]

=

 

 

G

[ G ]

 

 

 

< / fa</uc latHtc ahn>dle rs>

452

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

A Compensation Event Sub-Process is mapped to a WS-BPEL compensation handler as follows.

Compensation

[

 

]

 

<compe nsationHandler>

G

=

[G]

 

</compe nsationHandler>

Activity Loop Mapping

Standard loops with a testTime attribute “Before” or “After” execution of the Activity map to WS-BPEL while and repeatUntil activities in a straight-forward manner. When the LoopMaximum attribute is used, additional activities are used to maintain a loop counter.

Multi-instance Activities map to WS-BPEL forEach activities in a straight-forward manner.

Standard Loops

The mappings for standard loops to WS-BPEL are described in the following.

A standard loop with testTime= “Before” maps to WS-BPEL as follows, where p denotes the loop condition.

[

 

]

 

< w h i le>

 

 

 

 

 

T a s k

 

=

< c o n d iti o n >[p ] </ c o n d i tio n>

 

 

[ T a s k]

 

 

 

 

< /w h ile >

A standard loop with testTime= “After” maps as follows, where p denotes the loop condition.

[

 

]

 

<repe atUn til>

 

 

 

 

 

Task

 

=

[Task]

 

 

<con dition>[n ot p ]</cond ition>

 

 

 

 

 

 

 

</re peatUntil>

Dealing with LoopMaximum

When the LoopMaximum attribute is specified for an Activity, the loop requires additional set up for maintaining a counter.

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

453

A standard loop with testTime=“Before” and a LoopMaximum attribute maps to WS-BPEL as follows (again, p denotes the loopCondition).

<variable name="[counter]" type="xsd:integer"/>

...

<sequence> <assign>

<copy>

<from><literal>0</literal></from >

[

 

]

 

<to variable="[counter]"/>

 

 

</copy>

 

 

</assign>

 

 

<while>

Task

=

<condition>[p] and $[counter] < [LoopMaximum]</condition>

<sequence>

 

 

 

 

[G]

 

 

assign>

 

 

< <copy>

<from expression="$[counter]+1"/>

<to variable="[counter]" />

</copy> </assign> </sequence>

</while>

</sequence>

(The notation [counter] denotes the unique name of a variable used to hold the counter value; the actual name is immaterial.)

A standard loop with testTime=“After” and a LoopMaximum attribute maps as follows:

<variable name="[counter]" type="xsd:integer"/>

...

<sequence> <assign>

<copy>

<from><literal>0</literal></from>

<to variable="[counter]"/>

[

 

]

 

</copy>

 

 

</assign>

 

 

<repeatUntil>

Task

=

<sequence>

 

 

[G]

 

 

<assign>

 

 

copy>

 

 

< <from expression="$[counter]+1"/>

<to variable="[counter]" /> </copy>

</assign> </sequence>

<condition>[not p] or $[counter] > [LoopMaximum]</condition> </repeatUntil>

</sequence>

454

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