Architecting and designing > Business Process Analysis (BPA) > BPEL generation > BPEL to BPMN mapping reference > BPMN to BPEL mapping for Event-Based Gateways
  
BPMN to BPEL mapping for Event-Based Gateways
You can generate BPEL code for BPMN Event-Based Gateways.
The following three patterns apply to Event based gateways only. Whilst the three patterns are drawn differently, they are in fact logically the same and so the BPEL construct is the same as well for all three.
This graphic is described in the surrounding text.
This graphic is described in the surrounding text.
This graphic is described in the surrounding text.
Notes
This pattern applies only to event-based gateways.
There can be multiple diverging flows from the gateway but there always must be at least two as a minimum.
The process associated with the incoming meesage flow need not have its "BPMN Process".TaskType" property specified since in this pattern the process is explicitly a "Receive" task type.
The intermediate events must only be one of the following types: Message, Rule, Link, or Timer.
If the intermediate event type is a Message, Rule, or Link, there must be a process symbol in the path as shown with an incoming message flow associated with either the process or the intermediate event. For example as shown in the top path in the pattern examples. A message flow is not required if the intermediate event is a timer.
If the intermediate event is a timer, then the target activity can be a process, gateway or another event symbol. For example as shown in the bottom path in the all of pattern examples and no must be no incoming message flow.
BPEL comments
1 The gateway must be an "event based" gateway, this is determined from the gateway definition property Gateway.Stereotype.
2 A <pick> element is created and all subsequent constructs for this pattern reside within the element.
3 The createInstance attribute value is taken from the BPMN Gateway symbol property "Gateway". "Create Instance" and will be either a "yes" or "no".
4 The standard-attributes are determined from the gateway symbol.
5 For each outgoing sequence flow the intermediate event definition is obtained from the sequence flow definition. "Sequence Flow". "Initiating Event". If this is empty then the intermediate event is determined from the outgoing sequence flow connected from the gateway.
6 The intermediate event must be only one of the following Trigger Types property which is determined from "BPMN Event".Stereotype.
"message"
"rule"
"link"
"timer"
7 For each outgoing sequence flow that has message, rule, or link event then an <onMessage> element is created.
8 The ncname of the <partnerLink name> attribute is derived from the pool or lane that the message symbol is connected from or to by examining the name of the definition used in the pool or lane's property Participant.Participant.name, if the participant property is not populated the name is taken from the pool or lane name Pool.name or Lane.name.
9 The qname of the "portType" is constructed from the message flow symbol definition, which is a "Class" definition as follows.
"Message Flow"."Port Type" gives a "Class" definition, in which its stereotype must be a " WSDL PortType" Determined from Class.Stereotype.
The name of the "Class", Class.name is prefixed with the name of the "Namespace" property Class.Namespace and a colon.
10 The ncname of the <operation> is determined from the "Class" definition "Message Flow".Operation.name. The class stereotype must be a "WSDL Operation" determined from Class.Stereotype.
11 The ncname of the <variable> is taken from the BPEL Variable definition contained in "Message Flow"."Input Variable".name.
12 A <sequence> element is created and the ncname of the sequence taken from the sequence flow name. All subsequent activities reside within this sequence element occupying the position indicated by the "Target Process".
13 For each outgoing sequence flow that has timer event then an <onAlarm> element is created.
14 If the property "BPMN Event". "Time Date" is populated and the property "BPMN Event". "Time Cycle" is empty then for the until attribute the "deadline-expr" is populated with the property value.
15 If the property "BPMN Event". "Time Cycle" is populated and the property "BPMN Event". "Time Date" is empty then for the for attribute the "duration-expr" is populated with the property value.
16 A <sequence> element is created and the ncname of the sequence taken from the sequence flow name. All subsequent activities reside within this sequence element occupying the position indicated by the "Target Activity".
Element construct
<pick createInstance="yes|no"?
standard-attributes>
<onMessage
partnerLink="ncname"
portType="qname"
operation="ncname"
variable="ncname">
<sequence name = "ncname">
Target Process
</sequence>
</onMessage>
<onAlarm (for="duration-expr" | until="deadline-expr")>
<sequence name = "ncname">
Target Activity
</sequence>
</onAlarm>
</pick>
See also
BPEL to BPMN mapping reference