BPEL Patterns
BPEL Patterns
2)
N.A. Mulyar
1
Table of contents
Table of contents.................................................................................................................. 2
Introduction.......................................................................................................................... 3
1. Evaluation of Oracle BPEL PM from the control-flow perspective............................ 4
2. Evaluation of Oracle BPEL PM from the data perspective ..................................... 107
3. Evaluation of Oracle BPEL PM from the resource perspective .............................. 125
Conclusions...................................................................................................................... 153
Standardness and Completeness of Oracle BPEL PM................................................. 157
Related work .................................................................................................................... 158
Acknowledgements.......................................................................................................... 159
References........................................................................................................................ 160
2
Introduction
In the light of the emerging paradigm, known as web-services composition, for enabling
application integration within and across organizational boundaries several steps have
been made to systematically evaluate the capabilities and limitations of languages and
techniques proposed by different vendors and coalitions. In particular, an in-depth
analysis of the Business Process Execution Language for Web Services (BPEL4WS) has
been made in [1]. BPEL is a language that defines business processes and how these
processes interact within/between organizations. The comparison of BPEL to other web
services composition languages has been made in [2], [3], [4] and [15]. In all referred
sources the evaluation of the web services composition languages has been made from
the control-flow perspective, i.e. the degree of support of the 20 workflow patterns (cf.
www.workflowpatterns.com) has been analyzed.
To make BPEL operational, it has been implemented in numerous tools. Similar to the
evaluation of the BPEL core, the facilities offered by such tools have been a subject for
the evaluation. In particular, an analysis of web services workflow patterns in Collaxa has
been made in [11]. Based on the Collaxa engine [12] Oracle has implemented BPEL PM
Designer that offers facilities for modeling of processes which can be deployed and made
operational via the BPEL Console. The purpose of this work is to evaluate up to which
degree the workflow patterns are supported by Oracle BPEL. For the purposes of this
analysis we used not only the control-flow patterns described in [8], but also workflow
data patterns and workflow resource patterns described in [9] and [10] respectively.
While Workflow Control Patterns characterize the range of control flow constructs that
might be encountered when modeling and analyzing workflow, Workflow Data Patterns
and Workflow Resource Patterns capture the various ways in which data resources are
represented and utilized in workflows respectively. Workflow Control Patterns consist of
basic control patterns, advanced branching and synchronization patterns, structural
patterns, patterns involving multiple instances, state-based patterns and cancellation
patterns. Workflow Data Patterns consist of data visibility, data interaction, data transfer
and data-based routing patterns. In turn, Workflow Resource Patterns consist of creation
patterns, push patterns, pull patterns, detour patterns, auto-start patterns, visibility
patterns, and multiple resource patterns. These patterns have served as a reference
point for the evaluation of Oracle BPEL PM.
As a knowledge base for the tool we used the tutorials and training material Oracle
provided on-line (cf. http://www.oracle.com/technology/products/ias/bpel/index.html).
3
1. Evaluation of Oracle BPEL PM from the control-flow
perspective
CFP1: Sequence
Description: An activity in a workflow process is enabled after the completion of another
activity in the same process.
Oracle BPEL PM supports this pattern directly. Graphically, two activities available at the
BPEL Palette that can be connected by an arrow form a sequence. An example of the
<sequence> is given in Figure 1. The <receive> activity that gets an input message from
the client is followed by three <assign> activities which modify the input message. The
result of modification is returned synchronously to the client by means of the <reply>
activity.
4
The code snippets corresponding to this block diagram are shown below.
<process name="CFP1_sequence"
targetNamespace="http://xmlns.oracle.com/CFP1_sequence"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:client="http://xmlns.oracle.com/CFP1_sequence"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"><!--
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:CFP1_sequence"
myRole="CFP1_sequenceProvider"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation -->
<variable name="inputVariable"
messageType="client:CFP1_sequenceRequestMessage"/><!--
Reference to the message that will be returned to the requester
-->
<variable name="outputVariable"
messageType="client:CFP1_sequenceResponseMessage"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP1_sequence.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:CFP1_sequence" operation="process"
variable="inputVariable" createInstance="yes"/><!-- Generate reply to
synchronous request -->
5
<assign name="Assign_1">
<copy>
<from
expression="concat(bpws:getVariableData('inputVariable','payload','/clie
nt:CFP1_sequenceProcessRequest/client:input'),'1')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP1_sequenceProcessResponse/client:result"/>
</copy>
</assign>
<assign name="Assign_2">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP1_sequenceProcessResponse/client:result'),'2')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP1_sequenceProcessResponse/client:result"/>
</copy>
</assign>
<assign name="Assign_3">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP1_sequenceProcessResponse/client:result'),'3')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP1_sequenceProcessResponse/client:result"/>
</copy>
</assign>
<reply name="replyOutput" partnerLink="client"
portType="client:CFP1_sequence" operation="process"
variable="outputVariable"/>
</sequence>
</process>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL
process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and us them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~ -->
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
6
targetNamespace="http://xmlns.oracle.com/CFP1_sequence"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="CFP1_sequenceProcessRequest">
<complexType>
<sequence>
<element name="input"
type="string"/>
</sequence>
</complexType>
</element>
<element name="CFP1_sequenceProcessResponse">
<complexType>
<sequence>
<element name="result"
type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~ -->
<message name="CFP1_sequenceRequestMessage">
<part name="payload"
element="client:CFP1_sequenceProcessRequest"/>
</message>
<message name="CFP1_sequenceResponseMessage">
<part name="payload"
element="client:CFP1_sequenceProcessResponse"/>
</message>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~ -->
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
7
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~ -->
<plnk:partnerLinkType name="CFP1_sequence">
<plnk:role name="CFP1_sequenceProvider">
<plnk:portType name="client:CFP1_sequence"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
An audit trail visualizing the execution history of the considered example is shown below:
receiveInput
[2005/08/10 10:30:25] Received "inputVariable" call from partner "client" More...
Assign_1
[2005/08/10 10:30:25] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP1_sequenceProcessResponse xmlns="http://xmlns.oracle.com/CFP1_sequence">
<result>b1</result>
</CFP1_sequenceProcessResponse>
</part>
</outputVariable>
Assign_2
[2005/08/10 10:30:25] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP1_sequenceProcessResponse xmlns="http://xmlns.oracle.com/CFP1_sequence">
<result>b12</result>
</CFP1_sequenceProcessResponse>
</part>
</outputVariable>
Assign_3
[2005/08/10 10:30:25] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP1_sequenceProcessResponse xmlns="http://xmlns.oracle.com/CFP1_sequence">
<result>b123</result>
</CFP1_sequenceProcessResponse>
</part>
</outputVariable>
replyOutput
[2005/08/10 10:30:25] Reply to partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP1_sequenceProcessResponse xmlns="http://xmlns.oracle.com/CFP1_sequence">
8
<result>b123</result>
</CFP1_sequenceProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 10:30:25] BPEL process instance "202" completed
</process>
Another possibility to implement the sequence, which is not the most straightforward
solution, is to use links within the <flow> structure. In particular, to ensure that activities
Assign_1, Assign_2, and Assign_3 are executed in the sequential lexical order, these
activities are associated with links Link12 and Link23. As such the activity Assign_2
serves as a target of the Link12 and a source of the Link23. The process model of the
considered example is shown in Figure 2.
9
<process name="CFP1_flow_links"
targetNamespace="http://xmlns.oracle.com/CFP1_flow_links"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:client="http://xmlns.oracle.com/CFP1_flow_links"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"><!--
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:CFP1_flow_links"
myRole="CFP1_flow_linksProvider"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation -->
<variable name="inputVariable"
messageType="client:CFP1_flow_linksRequestMessage"/><!--
Reference to the message that will be returned to the requester
-->
<variable name="outputVariable"
messageType="client:CFP1_flow_linksResponseMessage"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP1_flow_links.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:CFP1_flow_links" operation="process"
variable="inputVariable" createInstance="yes"/><!-- Generate reply to
synchronous request -->
<flow name="Flow_1">
<links>
10
<link name="Link12"/>
<link name="Link23"/>
</links>
<sequence name="Sequence_3">
<target linkName="Link23"/>
<assign name="Assign_3">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP1_flow_linksProcessResponse/client:result'),'3')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP1_flow_linksProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
<sequence name="Sequence_2">
<target linkName="Link12"/>
<source linkName="Link23"/>
<assign name="Assign_2">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP1_flow_linksProcessResponse/client:result'),'2')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP1_flow_linksProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
<sequence name="Sequence_1">
<source linkName="Link12"/>
<assign name="Assign_1">
<copy>
<from
expression="concat(bpws:getVariableData('inputVariable','payload','/clie
nt:CFP1_flow_linksProcessRequest/client:input'),'1')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP1_flow_linksProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
</flow>
<reply name="replyOutput" partnerLink="client"
portType="client:CFP1_flow_links" operation="process"
variable="outputVariable"/>
</sequence>
</process>
An audit trail visualizing the execution history of the considered example is shown below:
receiveInput
[2005/08/10 10:45:24] Received "inputVariable" call from partner "client" less
<inputVariable>
11
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP1_flow_linksProcessRequest xmlns="http://xmlns.oracle.com/CFP1_flow_links">
<input>a</input>
</CFP1_flow_linksProcessRequest>
</part>
</inputVariable>
<flow>
<sequence>
Assign_1
[2005/08/10 10:45:24] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP1_flow_linksProcessResponse xmlns="http://xmlns.oracle.com/CFP1_flow_links">
<result>a1</result>
</CFP1_flow_linksProcessResponse>
</part>
</outputVariable>
</sequence>
<sequence>
Assign_2
[2005/08/10 10:45:24] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP1_flow_linksProcessResponse xmlns="http://xmlns.oracle.com/CFP1_flow_links">
<result>a12</result>
</CFP1_flow_linksProcessResponse>
</part>
</outputVariable>
</sequence>
<sequence>
Assign_3
[2005/08/10 10:45:24] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP1_flow_linksProcessResponse xmlns="http://xmlns.oracle.com/CFP1_flow_links">
<result>a123</result>
</CFP1_flow_linksProcessResponse>
</part>
</outputVariable>
</sequence>
</flow>
replyOutput
[2005/08/10 10:45:24] Reply to partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP1_flow_linksProcessResponse xmlns="http://xmlns.oracle.com/CFP1_flow_links">
<result>a123</result>
12
</CFP1_flow_linksProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 10:45:24] BPEL process instance "203" completed
</process>
Oracle BPEL PM supports this pattern directly by means of the <flow> construct. The
<flow> construct allows creating multiple branches, which are independent and may
execute in any order. Oracle BPEL PM implemented this construct with an assumption
that multiple activities will be present in every branch, therefore offering the <sequence>
construct as the wrapper for these activities.
13
Figure 3 Parallel split by means of <flow>
The code snippets corresponding to the considered example are shown below:
<process name="CFP23_flow"
targetNamespace="http://xmlns.oracle.com/CFP23_flow"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://xmlns.oracle.com/CFP23_flow"
14
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc">
<!-- ===========================================================>
<!-- PARTNERLINKS -
-><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:CFP23_flow"
myRole="CFP23_flowProvider"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation -->
<variable name="inputVariable"
messageType="client:CFP23_flowRequestMessage"/><!--
Reference to the message that will be returned to the requester
-->
<variable name="outputVariable"
messageType="client:CFP23_flowResponseMessage"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP23_flow.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:CFP23_flow" operation="process"
variable="inputVariable" createInstance="yes"/><!-- Generate reply to
synchronous request -->
<assign name="Assign_4">
<copy>
<from variable="inputVariable" part="payload"
query="/client:CFP23_flowProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:CFP23_flowProcessResponse/client:result"/>
</copy>
</assign>
<flow name="Flow_1">
<sequence name="Sequence_3">
<wait name="Wait_1" for="'PT1M'"/>
<assign name="Assign_3">
<copy>
15
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP23_flowProcessResponse/client:result'),'3')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP23_flowProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
<sequence name="Sequence_2">
<wait name="Wait_2" for="'PT2M'"/>
<assign name="Assign_2">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP23_flowProcessResponse/client:result'),'2')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP23_flowProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
<sequence name="Sequence_1">
<wait name="Wait_3" for="'PT3M'"/>
<assign name="Assign_1">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP23_flowProcessResponse/client:result'),'1')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP23_flowProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
</flow>
<reply name="replyOutput" partnerLink="client"
portType="client:CFP23_flow" operation="process"
variable="outputVariable"/>
</sequence>
</process>
An audit trail visualizing the execution history of the considered example is shown below:
receiveInput
[2005/08/10 10:57:53] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP23_flowProcessRequest xmlns="http://xmlns.oracle.com/CFP23_flow">
<input>b</input>
</CFP23_flowProcessRequest>
</part>
</inputVariable>
16
Assign_4
[2005/08/10 10:57:53] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP23_flowProcessResponse xmlns="http://xmlns.oracle.com/CFP23_flow">
<result>b</result>
</CFP23_flowProcessResponse>
</part>
</outputVariable>
<flow>
<sequence>
Wait_3 - pending
[2005/08/10 10:57:53] Waiting for the expiry time "2005/08/10 11:00:53".
<sequence>
Wait_2 - pending
[2005/08/10 10:57:53] Waiting for the expiry time "2005/08/10 10:59:53".
<sequence>
Wait_1
[2005/08/10 10:57:53] Waiting for the expiry time "2005/08/10 10:58:53".
[2005/08/10 10:58:53] Wait has finished.
Assign_3
[2005/08/10 10:58:53] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP23_flowProcessResponse xmlns="http://xmlns.oracle.com/CFP23_flow">
<result>b3</result>
</CFP23_flowProcessResponse>
</part>
</outputVariable>
</sequence>
CFP3 Synchronization
Description: A point in the process where multiple parallel branches converge into one
single thread of control, thus synchronizing multiple threads. It is an assumption of this
pattern that after an incoming branch has been completed, it cannot be completed again
while the merge is still waiting for other branches to be completed. Also, it is assumed
that the threads to be synchronized belong to the same global process instance (i.e., to
the same case in workflow terminology).
Oracle BPEL PM supports this pattern directly by means of the <flow> construct. Every
branch of the flow construct may be executed only once, and it completes only after all
branches have completed. See as a reference an example implementing Parallel Split
pattern.
17
CFP4 Exclusive Choice
Description: A point in the workflow process where, based on a decision or workflow
control data, one of several branches is chosen.
Oracle BPEL PM supports this pattern directly by means of the <switch> construct. The
<switch> allows making deterministic choice between several branches, i.e. cases,
depending on the fulfillment of the case conditions. If none of the specified conditions is
fulfilled, the <otherwise> branch is taken (or deemed to be taken). If the conditions for
several branches are satisfied, then the first one specified in the lexical order is taken.
An example demonstrating the use of the <switch> construct is given in Figure 4. Each of
the three branches is associated with a certain data conditions; the otherwise branch
handles all conditions not specified for the other two branches. Each of these data
conditions is evaluated after a string input has been supplied by the client. In order to
check which branch is to be selected when conditions associated with multiple branches
are satisfied, the branches with activities Assign_1 and Assign_2 are associated with
overlapping data conditions. As a result, if multiple cases can be selected, the first
branch specified in the lexical order is selected.
18
The code snippets describing the process model presented in Figure 4 are shown below:
<process name="CFP4_switch"
targetNamespace="http://xmlns.oracle.com/CFP4_switch"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://xmlns.oracle.com/CFP4_switch"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"><!--
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:CFP4_switch"
myRole="CFP4_switchProvider"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation -->
<variable name="inputVariable"
messageType="client:CFP4_switchRequestMessage"/><!--
Reference to the message that will be returned to the requester
-->
<variable name="outputVariable"
messageType="client:CFP4_switchResponseMessage"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP4_switch.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:CFP4_switch" operation="process"
variable="inputVariable" createInstance="yes"/><!-- Generate reply to
synchronous request -->
19
<switch name="Switch_1">
<case condition="contains('cde',
bpws:getVariableData('inputVariable','payload','/client:CFP4_switchProce
ssRequest/client:input'))">
<assign name="Assign_3">
<copy>
<from expression="'cde'"/>
<to variable="outputVariable" part="payload"
query="/client:CFP4_switchProcessResponse/client:result"/>
</copy>
</assign>
</case>
<case condition="contains('abc',
bpws:getVariableData('inputVariable','payload','/client:CFP4_switchProce
ssRequest/client:input'))">
<assign name="Assign_1">
<copy>
<from expression="'abc'"/>
<to variable="outputVariable" part="payload"
query="/client:CFP4_switchProcessResponse/client:result"/>
</copy>
</assign>
</case>
<otherwise>
<assign name="Assign_2">
<copy>
<from variable="inputVariable" part="payload"
query="/client:CFP4_switchProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:CFP4_switchProcessResponse/client:result"/>
</copy>
</assign>
</otherwise>
</switch>
<reply name="replyOutput" partnerLink="client"
portType="client:CFP4_switch" operation="process"
variable="outputVariable"/>
</sequence>
</process>
An audit trail visualizing the execution history of the considered example is shown below:
[2005/08/10 11:00:55] New instance of BPEL process "CFP4_switch" initiated (# "206").
<process>
<sequence>
receiveInput
[2005/08/10 11:00:55] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP4_switchProcessRequest xmlns="http://xmlns.oracle.com/CFP4_switch">
<input>a</input>
</CFP4_switchProcessRequest>
</part>
</inputVariable>
20
<switch>
Assign_1
[2005/08/10 11:00:55] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP4_switchProcessResponse xmlns="http://xmlns.oracle.com/CFP4_switch">
<result>abc</result>
</CFP4_switchProcessResponse>
</part>
</outputVariable>
</switch>
replyOutput
[2005/08/10 11:00:55] Reply to partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP4_switchProcessResponse xmlns="http://xmlns.oracle.com/CFP4_switch">
<result>abc</result>
</CFP4_switchProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 11:00:55] BPEL process instance "206" completed
</process>
receiveInput
[2005/08/10 11:00:47] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP4_switchProcessRequest xmlns="http://xmlns.oracle.com/CFP4_switch">
<input>c</input>
</CFP4_switchProcessRequest>
</part>
</inputVariable>
<switch>
Assign_3
[2005/08/10 11:00:47] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP4_switchProcessResponse xmlns="http://xmlns.oracle.com/CFP4_switch">
<result>cde</result>
</CFP4_switchProcessResponse>
</part>
21
</outputVariable>
</switch>
replyOutput
[2005/08/10 11:00:47] Reply to partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP4_switchProcessResponse xmlns="http://xmlns.oracle.com/CFP4_switch">
<result>cde</result>
</CFP4_switchProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 11:00:47] BPEL process instance "207" completed
</process>
receiveInput
[2005/08/10 11:11:41] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP4_switchProcessRequest xmlns="http://xmlns.oracle.com/CFP4_switch">
<input>f</input>
</CFP4_switchProcessRequest>
</part>
</inputVariable>
<switch>
Assign_2
[2005/08/10 11:11:41] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP4_switchProcessResponse xmlns="http://xmlns.oracle.com/CFP4_switch">
<result>f</result>
</CFP4_switchProcessResponse>
</part>
</outputVariable>
</switch>
replyOutput
[2005/08/10 11:11:41] Reply to partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP4_switchProcessResponse xmlns="http://xmlns.oracle.com/CFP4_switch">
<result>f</result>
</CFP4_switchProcessResponse>
</part>
22
</outputVariable>
</sequence>
[2005/08/10 11:11:41] BPEL process instance "208" completed
</process>
Another possibility to realize the Exclusive Choice pattern is to use links with disjoint
conditions within the <flow> construct (see Figure 5).
The source links associated with activities assignBr1 and assignBr2 are supplied with the
transitionCondition based on which the status of the link is defined. If both links are set to
negative, then the corresponding activities are skipped. All available branches are
synchronized by the <flow> construct after statuses of all available links have been
determined.
<sequence xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-
process/" name="main">
<!-- Receive input from requester.
Note: This maps to operation defined in
TestExclusiveChoice3.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="tns:TestExclusiveChoice3" operation="process" variable="input"
createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<flow xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
name="flow">
23
<links>
<link name="L1"/>
<link name="L2"/>
<!-- <link name="L1s"/>
<link name="L2s"/> -->
</links>
<!-- <sequence name="flow-sequence-1"> -->
<empty xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-
process/" name="ExclChoice">
<source linkName="L1"
transitionCondition="bpws:getVariableData("input","payloa
d","/tns:TestExclusiveChoice3Request/tns:input")=
"Car";"/>
<source linkName="L2"
transitionCondition="bpws:getVariableData("input","payloa
d","/tns:TestExclusiveChoice3Request/tns:input")=
"Hotel";"/>
</empty>
<!-- </sequence>-->
<!-- <sequence name="flow-sequence-2"> -->
<assign name="assignBr1">
<target linkName="L1"/>
<!-- <source linkName="L1s"/>-->
<copy>
<from expression=""b1";"></from>
<to variable="output" part="payload"
query="/tns:TestExclusiveChoice3Response/tns:result2"/>
</copy>
<copy>
<from variable="input" part="payload"
query="/tns:TestExclusiveChoice3Request/tns:input"></from>
<to variable="output" part="payload"
query="/tns:TestExclusiveChoice3Response/tns:result1"/>
</copy>
</assign>
<!-- </sequence>-->
<!-- <sequence name="flow-sequence-3">-->
<assign name="assignBr2">
<target linkName="L2"/>
<!-- <source linkName="L2s"/> -->
<copy>
<from variable="input" part="payload"
query="/tns:TestExclusiveChoice3Request/tns:input"></from>
<to variable="output" part="payload"
query="/tns:TestExclusiveChoice3Response/tns:result2"/>
</copy>
<copy>
<from expression=""B2";"></from>
<to variable="output" part="payload"
query="/tns:TestExclusiveChoice3Response/tns:result1"/>
</copy>
</assign>
<!-- </sequence> -->
<!-- <sequence name="flow-sequence-4" joinCondition="L1s OR L2s">
<target linkName="L1s"/>
<target linkName="L2s"/>
<empty name="simpleMerge">
24
</empty>
<assign name="assign-1">
<copy>
<from variable="input" part="payload"
query="/tns:TestExclusiveChoice3Request/tns:input"></from>
<to variable="output" part="payload"
query="/tns:TestExclusiveChoice3Response/tns:result1"/>
</copy>
</assign>
</sequence> -->
</flow>
<reply name="replyOutput" partnerLink="client"
portType="tns:TestExclusiveChoice3" operation="process"
variable="output"/>
</sequence>
An audit trail visualizing the execution history of the considered process is shown below:
client (process)
[2005/07/11 16:43:49] Received "input" call from partner "client" Less
<input>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<TestExclusiveChoice3Request xmlns="http://acm.org/samples">
<input>Car</input>
</TestExclusiveChoice3Request>
</part>
</input>
<flow>
Empty
[2005/07/11 16:43:49] BPEL "empty" activity is executed.
assignBr2
[2005/07/11 16:43:49] Activity skipped
assignBr1
[2005/07/11 16:43:49] Updated variable "output" Less
<output>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<TestExclusiveChoice3Response xmlns="http://acm.org/samples">
<result1 />
<result2>b1</result2>
</TestExclusiveChoice3Response>
</part>
</output>
[2005/07/11 16:43:49] Updated variable "output" Less
<output>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<TestExclusiveChoice3Response xmlns="http://acm.org/samples">
25
<result1>Car</result1>
<result2>b1</result2>
</TestExclusiveChoice3Response>
</part>
</output>
</flow>
client
[2005/07/11 16:43:49] Reply to partner "client". More...
</sequence>
Oracle BPEL PM supports this pattern directly by means of the <switch> construct or
links incorporated in the <flow> activity as it has been described for CFP4. By default the
functionality associated with the <switch> construct is a combination of a CFP4 Exclusive
Choice and CFP5 Simple Merge. Note that <switch> allows only one branch to be
selected, thus none of the alternative branches is ever executed in parallel. As soon as
the selected branch finished the execution, the <switch> normally terminates.
Usage of links with disjoint conditions within the <flow> construct permits only one
branch to be selected. As soon as the selected branch finished the execution, the <flow>
terminates.
CFP6 Multi-Choice
Description: A point in the process, where, based on a decision or control data, a number
of branches are chosen and executed as parallel threads.
This pattern can be realized by means of links embedded into the <flow> construct,
where activities Assign-2, Assign-3, Assign-4 are related to each other via links, the
source of which is an activity Assign_1. The synchronization of multiple branches is done
automatically by the <flow> construct, which terminates after the statuses of all links
have been determined and no activities that could execute are left. The process model
created for this pattern is shown in Figure 6. Based on the string input provided by the
client the transitionConditions associated with <assign> activities are evaluated. Thus, if
several conditions are satisfied, the correspondent branches become enabled and the
<assign> activities execute in parallel. If the client provided an input other than specified
in the transitionConditions, all branches are skipped.
26
Figure 6 Multi-choice by means of <flow> and links
27
-->
<partnerLink name="client" partnerLinkType="client:CFP67_flow_links"
myRole="CFP67_flow_linksProvider"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation -->
<variable name="inputVariable"
messageType="client:CFP67_flow_linksRequestMessage"/><!--
Reference to the message that will be returned to the requester
-->
<variable name="outputVariable"
messageType="client:CFP67_flow_linksResponseMessage"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP67_flow_links.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:CFP67_flow_links" operation="process"
variable="inputVariable" createInstance="yes"/><!-- Generate reply to
synchronous request -->
<flow name="Flow_1">
<links>
<link name="Link14"/>
<link name="Link13"/>
<link name="Link12"/>
</links>
<sequence name="Sequence_4">
<assign name="Assign_1">
<source linkName="Link12"
transitionCondition="contains('abc',bpws:getVariableData('outputVariable
','payload','/client:CFP67_flow_linksProcessResponse/client:result'))"/>
<source linkName="Link13"
transitionCondition="contains('bcd',bpws:getVariableData('outputVariable
','payload','/client:CFP67_flow_linksProcessResponse/client:result'))"/>
<source linkName="Link14"
transitionCondition="contains('cde',bpws:getVariableData('outputVariable
','payload','/client:CFP67_flow_linksProcessResponse/client:result'))"/>
<copy>
<from variable="inputVariable" part="payload"
query="/client:CFP67_flow_linksProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:CFP67_flow_linksProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
<sequence name="Sequence_3">
28
<target linkName="Link13"/>
<assign name="Assign_4">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP67_flow_linksProcessResponse/client:result'),'4')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP67_flow_linksProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
<sequence name="Sequence_2">
<target linkName="Link12"/>
<assign name="Assign_3">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP67_flow_linksProcessResponse/client:result'),'3')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP67_flow_linksProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
<sequence name="Sequence_1">
<target linkName="Link14"/>
<assign name="Assign_2">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP67_flow_linksProcessResponse/client:result'),'2')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP67_flow_linksProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
</flow>
<reply name="replyOutput" partnerLink="client"
portType="client:CFP67_flow_links" operation="process"
variable="outputVariable"/>
</sequence>
</process>
The audit trail reflecting the execution of the considered process is shown below:
receiveInput
[2005/08/10 11:31:19] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP67_flow_linksProcessRequest xmlns="http://xmlns.oracle.com/CFP67_flow_links">
<input>a</input>
</CFP67_flow_linksProcessRequest>
29
</part>
</inputVariable>
<flow>
<sequence>
Assign_1
[2005/08/10 11:31:19] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP67_flow_linksProcessResponse xmlns="http://xmlns.oracle.com/CFP67_flow_links">
<result>a</result>
</CFP67_flow_linksProcessResponse>
</part>
</outputVariable>
</sequence>
<sequence>
Skipping
[2005/08/10 11:31:19] Block skipped
</sequence>
<sequence>
Assign_3
[2005/08/10 11:31:19] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP67_flow_linksProcessResponse xmlns="http://xmlns.oracle.com/CFP67_flow_links">
<result>a3</result>
</CFP67_flow_linksProcessResponse>
</part>
</outputVariable>
</sequence>
<sequence>
Skipping
[2005/08/10 11:31:19] Block skipped
</sequence>
</flow>
replyOutput
[2005/08/10 11:31:19] Reply to partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP67_flow_linksProcessResponse xmlns="http://xmlns.oracle.com/CFP67_flow_links">
<result>a3</result>
</CFP67_flow_linksProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 11:31:19] BPEL process instance "211" completed
</process>
30
CFP7 Synchronizing Merge
Description: A point in the process where multiple paths converge into one single thread.
Some of these paths are active (i.e. they are being executed) and some are not. If only
one path is active, the activity after the merge is triggered as soon as this path
completes. If more than one path is active, synchronization of all active paths needs to
take place.
Oracle BPEL PM supports this pattern by means of links as it has been described for the
CFP6 Multiple Choice. Links with transition conditions are used to define which
branches within the <flow> construct are to be selected. The synchronization of branches
is done by the <flow> activity. The <flow> activity will only complete when each of its sub-
activities has either completed or has been skipped. The continuation of the process after
the synchronizing merge can be placed after the <flow> activity. Alternatively, the
continuation of the process can be placed in a separate branch of the <flow>, and the
joinCondition can be attached to the activity directly following the synchronizing merge.
CFP8 Multi-Merge
Description: A point in a process where two or more branches re-converge without
synchronization. If more than one branch gets activated, possibly concurrently, the
activity following the merge is started for every action of every incoming branch.
31
Figure 7 Multi-merge
32
The code snippets corresponding to Figure 7 are shown below:
<process name="CFP8_scope_event"
targetNamespace="http://xmlns.oracle.com/CFP8_scope_event"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:ns1="http://xmlns.oracle.com/dummy"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns2="http://xmlns.oracle.com/AsyncDummy"
xmlns:client="http://xmlns.oracle.com/CFP8_scope_event"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"><!--
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:CFP8_scope_event"
myRole="CFP8_scope_eventProvider"/>
<partnerLink myRole="AsyncDummyRequester" name="PartnerLink_1"
partnerRole="AsyncDummyProvider" partnerLinkType="ns2:AsyncDummy"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation --><!--
Reference to the message that will be returned to the requester
-->
<variable name="inputVariable"
messageType="client:CFP8_scope_eventRequestMessage"/>
<variable name="outputVariable"
messageType="client:CFP8_scope_eventResponseMessage"/>
<variable name="OnMessage_process_DummyVariable"
messageType="client:CFP8_scope_eventRequestMessage"/>
<variable name="StringVariable"
messageType="ns2:AsyncDummyRequestMessage"/>
<variable name="OnMessage_onResult_InputVariable"
messageType="ns2:AsyncDummyResponseMessage"/>
</variables>
<eventHandlers>
<onMessage portType="ns2:AsyncDummyCallback" operation="onResult"
variable="OnMessage_onResult_InputVariable" partnerLink="PartnerLink_1">
33
<assign name="Assign_4">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP8_scope_eventProcessResponse/client:result'),'4')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP8_scope_eventProcessResponse/client:result"/>
</copy>
</assign>
</onMessage>
</eventHandlers><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP8_scope_event.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:CFP8_scope_event" operation="process"
variable="inputVariable" createInstance="yes"/><!-- Generate reply to
synchronous request -->
<assign name="Assign_1">
<copy>
<from variable="inputVariable" part="payload"
query="/client:CFP8_scope_eventProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:CFP8_scope_eventProcessResponse/client:result"/>
</copy>
</assign>
<flow name="Flow_1">
<sequence name="Sequence_2">
<assign name="Assign_3">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP8_scope_eventProcessResponse/client:result'),'3')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP8_scope_eventProcessResponse/client:result"/>
</copy>
<copy>
<from expression="'3'"/>
<to variable="StringVariable" part="payload"
query="/ns2:AsyncDummyProcessRequest/ns2:input"/>
</copy>
</assign>
<invoke name="Invoke_2" partnerLink="PartnerLink_1"
portType="ns2:AsyncDummy" operation="initiate"
inputVariable="StringVariable"/>
</sequence>
<sequence name="Sequence_1">
<assign name="Assign_2">
<copy>
34
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP8_scope_eventProcessResponse/client:result'),'2')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP8_scope_eventProcessResponse/client:result"/>
</copy>
<copy>
<from expression="'2'"/>
<to variable="StringVariable" part="payload"
query="/ns2:AsyncDummyProcessRequest/ns2:input"/>
</copy>
</assign>
<invoke name="Invoke_1" partnerLink="PartnerLink_1"
portType="ns2:AsyncDummy" operation="initiate"
inputVariable="StringVariable"/>
</sequence>
</flow>
<pick name="Pick_1">
<onMessage portType="ns2:AsyncDummyCallback" operation="onResult"
variable="OnMessage_onResult_InputVariable" partnerLink="PartnerLink_1">
<empty name="Empty_1"/>
</onMessage>
<onAlarm for="'PT10S'">
<wait name="Wait_1" for="'PT30S'"/>
</onAlarm>
</pick>
<reply name="replyOutput" partnerLink="client"
portType="client:CFP8_scope_event" operation="process"
variable="outputVariable"/>
</sequence>
</process>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL
process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and us them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/CFP8_scope_event"
xmlns="http://www.w3.org/2001/XMLSchema">
35
<element name="CFP8_scope_eventProcessRequest">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="CFP8_scope_eventProcessResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<message name="CFP8_scope_eventRequestMessage">
<part name="payload"
element="client:CFP8_scope_eventProcessRequest"/>
</message>
<message name="CFP8_scope_eventResponseMessage">
<part name="payload"
element="client:CFP8_scope_eventProcessResponse"/>
</message>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<plnk:partnerLinkType name="CFP8_scope_event">
<plnk:role name="CFP8_scope_eventProvider">
36
<plnk:portType name="client:CFP8_scope_event"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
An audit trail demonstrating the execution history of the considered process model
(based on <pick> construct) is shown below:
receiveInput
[2005/08/10 14:40:27] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP8_scope_eventProcessRequest xmlns="http://xmlns.oracle.com/CFP8_scope_event">
<input>a</input>
</CFP8_scope_eventProcessRequest>
</part>
</inputVariable>
Assign_1
[2005/08/10 14:40:27] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP8_scope_eventProcessResponse xmlns="http://xmlns.oracle.com/CFP8_scope_event">
<result>a</result>
</CFP8_scope_eventProcessResponse>
</part>
</outputVariable>
<flow>
<sequence>
Assign_2
[2005/08/10 14:40:27] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP8_scope_eventProcessResponse xmlns="http://xmlns.oracle.com/CFP8_scope_event">
<result>a2</result>
</CFP8_scope_eventProcessResponse>
</part>
</outputVariable>
[2005/08/10 14:40:27] Updated variable "StringVariable" less
<StringVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>2</input>
</AsyncDummyProcessRequest>
</part>
</StringVariable>
37
Invoke_1
[2005/08/10 14:40:27] Invoked 1-way operation "initiate" on partner "PartnerLink_1".
less
<StringVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>3</input>
</AsyncDummyProcessRequest>
</part>
</StringVariable>
</sequence>
<sequence>
Assign_3
[2005/08/10 14:40:27] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP8_scope_eventProcessResponse xmlns="http://xmlns.oracle.com/CFP8_scope_event">
<result>a23</result>
</CFP8_scope_eventProcessResponse>
</part>
</outputVariable>
[2005/08/10 14:40:27] Updated variable "StringVariable" less
<StringVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>3</input>
</AsyncDummyProcessRequest>
</part>
</StringVariable>
Invoke_2
[2005/08/10 14:40:27] Invoked 1-way operation "initiate" on partner "PartnerLink_1".
less
<StringVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>3</input>
</AsyncDummyProcessRequest>
</part>
</StringVariable>
</sequence>
</flow>
<pick>
onMessage (77)
[2005/08/10 14:40:27] Waiting for message from "PartnerLink_1", operation is
"onResult".
[2005/08/10 14:40:29] Received "onResult" callback from partner "PartnerLink_1" less
<OnMessage_onResult_InputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
38
<AsyncDummyProcessResponse xmlns="http://xmlns.oracle.com/AsyncDummy">
<result>3</result>
</AsyncDummyProcessResponse>
</part>
</OnMessage_onResult_InputVariable>
onAlarm (80) (cancelled)
[2005/08/10 14:40:27] Alarm started. Alarm will go off at time "2005/08/10
14:40:37".
[2005/08/10 14:40:29] BPEL "onAlarm" cancelled before being triggered.
<onMessage>
Empty
[2005/08/10 14:40:29] BPEL "empty" activity is executed.
</onMessage>
</pick>
replyOutput
[2005/08/10 14:40:29] Reply to partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP8_scope_eventProcessResponse xmlns="http://xmlns.oracle.com/CFP8_scope_event">
<result>a23</result>
</CFP8_scope_eventProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 14:40:29] BPEL process instance "231" completed
</process>
receiveInput
[2005/08/10 14:40:30] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>3</input>
</AsyncDummyProcessRequest>
</part>
</inputVariable>
Assign_1
[2005/08/10 14:40:30] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessResponse xmlns="http://xmlns.oracle.com/AsyncDummy">
<result>3</result>
39
</AsyncDummyProcessResponse>
</part>
</outputVariable>
callbackClient
[2005/08/10 14:40:31] Invoked 1-way operation "onResult" on partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessResponse xmlns="http://xmlns.oracle.com/AsyncDummy">
<result>3</result>
</AsyncDummyProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 14:40:31] BPEL process instance "233" completed
</process>
CFP9 Discriminator
Description: A point in the workflow process that waits for one of the incoming branches
to complete before activating the subsequent activity. From that moment on it waits for all
remaining branches to complete and 'ignores' them. Once all incoming branches have
been triggered, it resets itself so that it can be triggered again (which is important
otherwise it could not really be used in the context of a loop).
Oracle BPEL PM does not support this pattern directly since according to the BPEL
specification joinCondition is evaluated after all branches were triggered, but not after the
first branch has completed.
Oracle BPEL PM does not support this pattern directly. The only possibility to define
loops offered by Oracle BPEL PM is by using the <while> construct (see Figure 8),
however it allows only one input and output end-points, and does not permit arbitrary
jumps into the body of a loop.
40
Figure 8 The <while> construct
<process name="CFP10_while"
targetNamespace="http://xmlns.oracle.com/CFP10_while"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20" xmlns:ns1="http://www.w3.org/2001/XMLSchema"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://xmlns.oracle.com/CFP10_while"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"><!--
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
41
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:CFP10_while"
myRole="CFP10_whileProvider"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation --><!--
Reference to the message that will be returned to the requester
-->
<variable name="inputVariable"
messageType="client:CFP10_whileRequestMessage"/>
<variable name="outputVariable"
messageType="client:CFP10_whileResponseMessage"/>
<variable name="LoopCounter" type="ns1:integer"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP10_while.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:CFP10_while" operation="process"
variable="inputVariable" createInstance="yes"/><!-- Generate reply to
synchronous request -->
<assign name="Assign_1">
<copy>
<from expression="3"/>
<to variable="LoopCounter"/>
</copy>
<copy>
<from variable="inputVariable" part="payload"
query="/client:CFP10_whileProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:CFP10_whileProcessResponse/client:result"/>
</copy>
</assign>
<while name="While_1" condition="bpws:getVariableData('LoopCounter')
> 0">
<assign name="Assign_2">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
42
ent:CFP10_whileProcessResponse/client:result'),string(bpws:getVariableDa
ta('LoopCounter')))"/>
<to variable="outputVariable" part="payload"
query="/client:CFP10_whileProcessResponse/client:result"/>
</copy>
<copy>
<from expression="bpws:getVariableData('LoopCounter') - 1"/>
<to variable="LoopCounter"/>
</copy>
</assign>
</while>
<reply name="replyOutput" partnerLink="client"
portType="client:CFP10_while" operation="process"
variable="outputVariable"/>
</sequence>
</process>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL
process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and us them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/CFP10_while"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="CFP10_whileProcessRequest">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="CFP10_whileProcessResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
43
</types>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<message name="CFP10_whileRequestMessage">
<part name="payload"
element="client:CFP10_whileProcessRequest"/>
</message>
<message name="CFP10_whileResponseMessage">
<part name="payload"
element="client:CFP10_whileProcessResponse"/>
</message>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- portType implemented by the CFP10_while BPEL process -->
<portType name="CFP10_while">
<operation name="process">
<input message="client:CFP10_whileRequestMessage" />
<output message="client:CFP10_whileResponseMessage"/>
</operation>
</portType>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<plnk:partnerLinkType name="CFP10_while">
<plnk:role name="CFP10_whileProvider">
<plnk:portType name="client:CFP10_while"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
The audit trail reflecting the execution of the considered process is shown below:
receiveInput
[2005/08/10 13:45:03] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP10_whileProcessRequest xmlns="http://xmlns.oracle.com/CFP10_while">
<input>a</input>
</CFP10_whileProcessRequest>
</part>
</inputVariable>
44
Assign_1
[2005/08/10 13:45:03] Updated variable "LoopCounter" less
<LoopCounter>3</LoopCounter>
[2005/08/10 13:45:03] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP10_whileProcessResponse xmlns="http://xmlns.oracle.com/CFP10_while">
<result>a</result>
</CFP10_whileProcessResponse>
</part>
</outputVariable>
<while>
Assign_2
[2005/08/10 13:45:03] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP10_whileProcessResponse xmlns="http://xmlns.oracle.com/CFP10_while">
<result>a3</result>
</CFP10_whileProcessResponse>
</part>
</outputVariable>
[2005/08/10 13:45:03] Updated variable "LoopCounter" less
<LoopCounter>2</LoopCounter>
Assign_2
[2005/08/10 13:45:03] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP10_whileProcessResponse xmlns="http://xmlns.oracle.com/CFP10_while">
<result>a32</result>
</CFP10_whileProcessResponse>
</part>
</outputVariable>
[2005/08/10 13:45:03] Updated variable "LoopCounter" less
<LoopCounter>1</LoopCounter>
Assign_2
[2005/08/10 13:45:03] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP10_whileProcessResponse xmlns="http://xmlns.oracle.com/CFP10_while">
<result>a321</result>
</CFP10_whileProcessResponse>
</part>
</outputVariable>
[2005/08/10 13:45:03] Updated variable "LoopCounter" less
<LoopCounter>0</LoopCounter>
</while>
replyOutput
[2005/08/10 13:45:03] Reply to partner "client". less
45
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP10_whileProcessResponse xmlns="http://xmlns.oracle.com/CFP10_while">
<result>a321</result>
</CFP10_whileProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 13:45:03] BPEL process instance "215" completed
</process>
Oracle BPEL PM supports this pattern directly by the <flow> construct, which terminates
when no activities within its body can be triggered and executed any more.
Oracle BPEL PM supports this pattern by placing an <invoke> construct within the body
of a <while> loop (see Figure 9).
46
Figure 9 MI instances without synchronization
47
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"><!--
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client"
partnerLinkType="client:CFP12_while_invoke"
myRole="CFP12_while_invokeProvider"/>
<partnerLink myRole="AsyncDummyRequester" name="AsyncService"
partnerRole="AsyncDummyProvider" partnerLinkType="ns2:AsyncDummy"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation --><!--
Reference to the message that will be returned to the requester
-->
<variable name="inputVariable"
messageType="client:CFP12_while_invokeRequestMessage"/>
<variable name="outputVariable"
messageType="client:CFP12_while_invokeResponseMessage"/>
<variable name="LoopCounter" type="ns1:integer"/>
<variable name="StringVariable"
messageType="ns2:AsyncDummyRequestMessage"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP12_while_invoke.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:CFP12_while_invoke" operation="process"
variable="inputVariable" createInstance="yes"/><!-- Generate reply to
synchronous request -->
<assign name="Assign_1">
<copy>
<from expression="3"/>
<to variable="LoopCounter"/>
</copy>
<copy>
48
<from variable="inputVariable" part="payload"
query="/client:CFP12_while_invokeProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:CFP12_while_invokeProcessResponse/client:result"/>
</copy>
<copy>
<from variable="inputVariable" part="payload"
query="/client:CFP12_while_invokeProcessRequest/client:input"/>
<to variable="StringVariable" part="payload"
query="/ns2:AsyncDummyProcessRequest/ns2:input"/>
</copy>
</assign>
<while name="While_1" condition="bpws:getVariableData('LoopCounter')
> 0">
<sequence name="Sequence_1">
<assign name="Assign_2">
<copy>
<from expression="bpws:getVariableData('LoopCounter') - 1"/>
<to variable="LoopCounter"/>
</copy>
<copy>
<from
expression="concat(bpws:getVariableData('StringVariable','payload','/ns2
:AsyncDummyProcessRequest/ns2:input'), '.')"/>
<to variable="StringVariable" part="payload"
query="/ns2:AsyncDummyProcessRequest/ns2:input"/>
</copy>
</assign>
<invoke name="Invoke_1" partnerLink="AsyncService"
portType="ns2:AsyncDummy" operation="initiate"
inputVariable="StringVariable"/>
</sequence>
</while>
<reply name="replyOutput" partnerLink="client"
portType="client:CFP12_while_invoke" operation="process"
variable="outputVariable"/>
</sequence>
</process>
The audit trail reflecting the execution of the considered process is shown below:
receiveInput
[2005/08/10 14:17:12] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP12_while_invokeProcessRequest xmlns="http://xmlns.oracle.com/CFP12_while_invoke">
<input>a</input>
</CFP12_while_invokeProcessRequest>
</part>
</inputVariable>
49
Assign_1
[2005/08/10 14:17:12] Updated variable "LoopCounter" less
<LoopCounter>3</LoopCounter>
[2005/08/10 14:17:12] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP12_while_invokeProcessResponse xmlns="http://xmlns.oracle.com/CFP12_while_invoke">
<result>a</result>
</CFP12_while_invokeProcessResponse>
</part>
</outputVariable>
[2005/08/10 14:17:12] Updated variable "StringVariable" less
<StringVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>a</input>
</AsyncDummyProcessRequest>
</part>
</StringVariable>
<while>
<sequence>
Assign_2
[2005/08/10 14:17:12] Updated variable "LoopCounter" less
<LoopCounter>2</LoopCounter>
[2005/08/10 14:17:12] Updated variable "StringVariable" less
<StringVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>a.</input>
</AsyncDummyProcessRequest>
</part>
</StringVariable>
Invoke_1
[2005/08/10 14:17:13] Invoked 1-way operation "initiate" on partner "AsyncService".
less
<StringVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>a.</input>
</AsyncDummyProcessRequest>
</part>
</StringVariable>
</sequence>
<sequence>
Assign_2
[2005/08/10 14:17:13] Updated variable "LoopCounter" less
<LoopCounter>1</LoopCounter>
[2005/08/10 14:17:13] Updated variable "StringVariable" less
50
<StringVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>a..</input>
</AsyncDummyProcessRequest>
</part>
</StringVariable>
Invoke_1
[2005/08/10 14:17:13] Invoked 1-way operation "initiate" on partner "AsyncService".
less
<StringVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>a..</input>
</AsyncDummyProcessRequest>
</part>
</StringVariable>
</sequence>
<sequence>
Assign_2
[2005/08/10 14:17:13] Updated variable "LoopCounter" less
<LoopCounter>0</LoopCounter>
[2005/08/10 14:17:13] Updated variable "StringVariable" less
<StringVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>a...</input>
</AsyncDummyProcessRequest>
</part>
</StringVariable>
Invoke_1
[2005/08/10 14:17:13] Invoked 1-way operation "initiate" on partner "AsyncService".
less
<StringVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>a...</input>
</AsyncDummyProcessRequest>
</part>
</StringVariable>
</sequence>
</while>
replyOutput
[2005/08/10 14:17:13] Reply to partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP12_while_invokeProcessResponse xmlns="http://xmlns.oracle.com/CFP12_while_invoke">
<result>a</result>
51
</CFP12_while_invokeProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 14:17:13] BPEL process instance "221" completed
</process>
receiveInput
[2005/08/10 14:17:15] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessRequest xmlns="http://xmlns.oracle.com/AsyncDummy">
<input>a..</input>
</AsyncDummyProcessRequest>
</part>
</inputVariable>
Assign_1
[2005/08/10 14:17:15] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessResponse xmlns="http://xmlns.oracle.com/AsyncDummy">
<result>a..</result>
</AsyncDummyProcessResponse>
</part>
</outputVariable>
callbackClient
[2005/08/10 14:17:15] Invoked 1-way operation "onResult" on partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<AsyncDummyProcessResponse xmlns="http://xmlns.oracle.com/AsyncDummy">
<result>a..</result>
</AsyncDummyProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 14:17:15] BPEL process instance "224" completed
</process>
The wsdl code associated with the considered process is shown below:
52
<definitions name="CFP12_while_invoke"
targetNamespace="http://xmlns.oracle.com/CFP12_while_invoke"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:client="http://xmlns.oracle.com/CFP12_while_invoke"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-
link/">
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL
process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and us them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/CFP12_while_invoke"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="CFP12_while_invokeProcessRequest">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="CFP12_while_invokeProcessResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<message name="CFP12_while_invokeRequestMessage">
<part name="payload"
element="client:CFP12_while_invokeProcessRequest"/>
</message>
<message name="CFP12_while_invokeResponseMessage">
<part name="payload"
element="client:CFP12_while_invokeProcessResponse"/>
</message>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
53
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<!-- portType implemented by the CFP12_while_invoke BPEL process -->
<portType name="CFP12_while_invoke">
<operation name="process">
<input message="client:CFP12_while_invokeRequestMessage" />
<output message="client:CFP12_while_invokeResponseMessage"/>
</operation>
</portType>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<plnk:partnerLinkType name="CFP12_while_invoke">
<plnk:role name="CFP12_while_invokeProvider">
<plnk:portType name="client:CFP12_while_invoke"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
The invoked AsyncDummy process must have an attribute createInstance set to "yes".
Oracle BPEL PM supports this pattern by placing replicas of an activity on the separate
branches of the <flow> activity. There should be so many branches as many instances
are required. For the details of the <flow> construct see the pattern Parallel Split.
54
Figure 10 MI task with a-priori design-time knowledge
<process name="CFP13_flown"
targetNamespace="http://xmlns.oracle.com/CFP13_flown"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://xmlns.oracle.com/CFP13_flown"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
55
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"><!--
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:CFP13_flown"
myRole="CFP13_flownProvider"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation -->
<variable name="inputVariable"
messageType="client:CFP13_flownRequestMessage"/><!--
Reference to the message that will be returned to the requester
-->
<variable name="outputVariable"
messageType="client:CFP13_flownResponseMessage"/>
<variable name="FlowN_1_Variable" type="xsd:int"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP13_flown.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:CFP13_flown" operation="process"
variable="inputVariable" createInstance="yes"/><!-- Generate reply to
synchronous request -->
<assign name="Assign_1">
<copy>
<from variable="inputVariable" part="payload"
query="/client:CFP13_flownProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:CFP13_flownProcessResponse/client:result"/>
</copy>
</assign>
<bpelx:flowN name="FlowN_1" N="3" indexVariable="FlowN_1_Variable">
<sequence name="Sequence_1">
<assign name="Assign_2">
<copy>
56
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP13_flownProcessResponse/client:result'), '.')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP13_flownProcessResponse/client:result"/>
</copy>
</assign>
<wait name="Wait_1" for="'PT10S'"/>
</sequence>
</bpelx:flowN>
<reply name="replyOutput" partnerLink="client"
portType="client:CFP13_flown" operation="process"
variable="outputVariable"/>
</sequence>
</process>
The audit trail reflecting the execution of the considered process is shown below:
receiveInput
[2005/08/10 14:57:16] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP13_flownProcessRequest xmlns="http://xmlns.oracle.com/CFP13_flown">
<input>a</input>
</CFP13_flownProcessRequest>
</part>
</inputVariable>
Assign_1
[2005/08/10 14:57:16] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP13_flownProcessResponse xmlns="http://xmlns.oracle.com/CFP13_flown">
<result>a</result>
</CFP13_flownProcessResponse>
</part>
</outputVariable>
<flowN>
<FlowN_1_Variable=0>
<sequence>
Assign_2
[2005/08/10 14:57:16] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP13_flownProcessResponse xmlns="http://xmlns.oracle.com/CFP13_flown">
<result>a...</result>
</CFP13_flownProcessResponse>
</part>
57
</outputVariable>
Wait_1
[2005/08/10 14:57:16] Waiting for the expiry time "2005/08/10 14:57:26".
[2005/08/10 14:57:28] Wait has finished.
</sequence>
</FlowN_1_Variable=0>
<FlowN_1_Variable=1>
<sequence>
Assign_2
[2005/08/10 14:57:16] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP13_flownProcessResponse xmlns="http://xmlns.oracle.com/CFP13_flown">
<result>a..</result>
</CFP13_flownProcessResponse>
</part>
</outputVariable>
Wait_1
[2005/08/10 14:57:16] Waiting for the expiry time "2005/08/10 14:57:26".
[2005/08/10 14:57:27] Wait has finished.
</sequence>
</FlowN_1_Variable=1>
<FlowN_1_Variable=2>
<sequence>
Assign_2
[2005/08/10 14:57:16] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP13_flownProcessResponse xmlns="http://xmlns.oracle.com/CFP13_flown">
<result>a.</result>
</CFP13_flownProcessResponse>
</part>
</outputVariable>
Wait_1
[2005/08/10 14:57:16] Waiting for the expiry time "2005/08/10 14:57:26".
[2005/08/10 14:57:26] Wait has finished.
</sequence>
</FlowN_1_Variable=2>
</flowN>
replyOutput
[2005/08/10 14:57:28] Reply to partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP13_flownProcessResponse xmlns="http://xmlns.oracle.com/CFP13_flown">
<result>a...</result>
</CFP13_flownProcessResponse>
58
</part>
</outputVariable>
</sequence>
[2005/08/10 14:57:28] BPEL process instance "234" completed
</process>
In CFP14 the number of instances is known at some stage during run time, but before
the initiation of the instances has started.
Standard BPEL does not support this pattern, however Oracle BPEL PM has
implemented the <flowN> construct which supports it. The <flowN> on the moment of
initiation of the process instance requests the number of task instances that should be
created, and creates the specified number of instances at run-time. An example of
creating multiple instances of an activity Assign_2 with run-time a-priori knowledge is
shown in Figure 11.
59
Figure 11 MI with synchronization a-priori run-time
The code snippets corresponding to the considered process model are shown below:
<process name="CFP14_flown"
targetNamespace="http://xmlns.oracle.com/CFP14_flown"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20" xmlns:ns1="http://www.w3.org/2001/XMLSchema"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://xmlns.oracle.com/CFP14_flown"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"><!--
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:CFP14_flown"
myRole="CFP14_flownProvider"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation --><!--
Reference to the message that will be returned to the requester
-->
<variable name="inputVariable"
messageType="client:CFP14_flownRequestMessage"/>
<variable name="outputVariable"
messageType="client:CFP14_flownResponseMessage"/>
<variable name="FlowN_1_Variable" type="xsd:int"/>
<variable name="Counter" type="ns1:integer"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP14_flown.wsdl
-->
60
<receive name="receiveInput" partnerLink="client"
portType="client:CFP14_flown" operation="process"
variable="inputVariable" createInstance="yes"/><!-- Generate reply to
synchronous request -->
<assign name="Assign_1">
<copy>
<from variable="inputVariable" part="payload"
query="/client:CFP14_flownProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:CFP14_flownProcessResponse/client:result"/>
</copy>
<copy>
<from
expression="number(bpws:getVariableData('inputVariable','payload','/clie
nt:CFP14_flownProcessRequest/client:input'))"/>
<to variable="Counter"/>
</copy>
</assign>
<bpelx:flowN name="FlowN_1" N="bpws:getVariableData('Counter')"
indexVariable="FlowN_1_Variable">
<assign name="Assign_2">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP14_flownProcessResponse/client:result'), '.')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP14_flownProcessResponse/client:result"/>
</copy>
</assign>
</bpelx:flowN>
<reply name="replyOutput" partnerLink="client"
portType="client:CFP14_flown" operation="process"
variable="outputVariable"/>
</sequence>
</process>
An audit trail visualizing the execution history of the considered example is shown below:
receiveInput
[2005/08/10 15:00:38] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP14_flownProcessRequest xmlns="http://xmlns.oracle.com/CFP14_flown">
<input>3</input>
</CFP14_flownProcessRequest>
</part>
</inputVariable>
Assign_1
[2005/08/10 15:00:38] Updated variable "outputVariable" less
<outputVariable>
61
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP14_flownProcessResponse xmlns="http://xmlns.oracle.com/CFP14_flown">
<result>3</result>
</CFP14_flownProcessResponse>
</part>
</outputVariable>
[2005/08/10 15:00:38] Updated variable "Counter" less
<Counter>3</Counter>
<flowN>
<FlowN_1_Variable=0>
Assign_2
[2005/08/10 15:00:38] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP14_flownProcessResponse xmlns="http://xmlns.oracle.com/CFP14_flown">
<result>3.</result>
</CFP14_flownProcessResponse>
</part>
</outputVariable>
</FlowN_1_Variable=0>
<FlowN_1_Variable=1>
Assign_2
[2005/08/10 15:00:38] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP14_flownProcessResponse xmlns="http://xmlns.oracle.com/CFP14_flown">
<result>3..</result>
</CFP14_flownProcessResponse>
</part>
</outputVariable>
</FlowN_1_Variable=1>
<FlowN_1_Variable=2>
Assign_2
[2005/08/10 15:00:38] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP14_flownProcessResponse xmlns="http://xmlns.oracle.com/CFP14_flown">
<result>3...</result>
</CFP14_flownProcessResponse>
</part>
</outputVariable>
</FlowN_1_Variable=2>
</flowN>
replyOutput
[2005/08/10 15:00:38] Reply to partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
62
<CFP14_flownProcessResponse xmlns="http://xmlns.oracle.com/CFP14_flown">
<result>3...</result>
</CFP14_flownProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 15:00:38] BPEL process instance "235" completed
</process>
receiveInput
[2005/08/10 15:10:00] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP14_flownProcessRequest xmlns="http://xmlns.oracle.com/CFP14_flown">
<input>0</input>
</CFP14_flownProcessRequest>
</part>
</inputVariable>
Assign_1
[2005/08/10 15:10:00] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP14_flownProcessResponse xmlns="http://xmlns.oracle.com/CFP14_flown">
<result>0</result>
</CFP14_flownProcessResponse>
</part>
</outputVariable>
[2005/08/10 15:10:00] Updated variable "Counter" less
<Counter>0</Counter>
<flowN>
Input = -3:
Your test request generated the following exception/fault:
java.lang.NegativeArraySizeException
Input = 1000:
Your test request generated the following exception/fault:
java.rmi.RemoteException: No Exception - originate
from:java.lang.Exception: No Exception - originate from:; nested
exception is:
java.lang.Exception: No Exception - originate from:
63
In CFP15 the number of instances to be created is not known in advance: new instances
are created on demand, until no more instances are required.
Oracle BPEL PM offers no direct support for this pattern, however the workaround can
be found by means of placing the <pick> construct within the <while> loop. The <pick>
should be configured to react on three types of messages: the first message Start
corresponds to the creation of an activity; the second message Finish corresponds to the
completion of the started activity; the third message NoMore notifies that no more
instances of the activity will be created any more. Thus the logic of this pattern is based
on the logical expression evaluating the value of a counter i, which is increased and
decreased if a new task instance is created and finished respectively, and the status of
the Boolean variable moreInstances indicating whether new instances are still to be
created. The process model incorporating this pattern is shown in Figure 12.
64
Figure 12 MI with synchronization (run-time)
The source code corresponding to the considered process model is shown below:
<process name="CFP15_while_pick"
targetNamespace="http://xmlns.oracle.com/CFP15_while_pick"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
65
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:ns1="http://www.w3.org/2001/XMLSchema"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:client="http://xmlns.oracle.com/CFP15_while_pick"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"><!--
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:CFP15_while_pick"
myRole="CFP15_while_pickProvider"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation --><!--
Reference to the message that will be returned to the requester
-->
<variable name="inputVariable"
messageType="client:CFP15_while_pickRequestMessage"/>
<variable name="outputVariable"
messageType="client:CFP15_while_pickResponseMessage"/>
<variable name="OnMessage_start_InputVariable"
messageType="client:CFP15_while_pickStartMessage"/>
<variable name="Counter" type="ns1:integer"/>
<variable name="MoreInstances" type="ns1:integer"/>
<variable name="OnMessage_finish_InputVariable"
messageType="client:CFP15_while_pickFinishMessage"/>
<variable name="OnMessage_noMore_InputVariable"
messageType="client:CFP15_while_pickNoMoreMessage"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP15_while_pick.wsdl
-->
66
<receive name="receiveInput" partnerLink="client"
portType="client:CFP15_while_pick" operation="process"
variable="inputVariable" createInstance="yes"/><!-- Generate reply to
synchronous request -->
<assign name="Assign_2">
<copy>
<from variable="inputVariable" part="payload"
query="/client:CFP15_while_pickProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:CFP15_while_pickProcessResponse/client:result"/>
</copy>
<copy>
<from expression="0"/>
<to variable="Counter"/>
</copy>
<copy>
<from expression="1"/>
<to variable="MoreInstances"/>
</copy>
</assign>
<while name="While_1"
condition="bpws:getVariableData('MoreInstances') +
bpws:getVariableData('Counter') > 0">
<pick name="Pick_1">
<onMessage portType="client:CFP15_while_pick" operation="start"
variable="OnMessage_start_InputVariable" partnerLink="client">
<sequence name="Sequence_1">
<assign name="Assign_1">
<copy>
<from expression="bpws:getVariableData('Counter') + 1"/>
<to variable="Counter"/>
</copy>
</assign>
<assign name="Assign_5">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP15_while_pickProcessResponse/client:result'), '.')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP15_while_pickProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
</onMessage>
<onMessage portType="client:CFP15_while_pick" operation="finish"
variable="OnMessage_finish_InputVariable" partnerLink="client">
<assign name="Assign_3">
<copy>
<from expression="bpws:getVariableData('Counter') - 1"/>
<to variable="Counter"/>
</copy>
</assign>
</onMessage>
<onMessage portType="client:CFP15_while_pick" operation="noMore"
variable="OnMessage_noMore_InputVariable" partnerLink="client">
<assign name="Assign_4">
<copy>
67
<from expression="0"/>
<to variable="MoreInstances"/>
</copy>
</assign>
</onMessage>
</pick>
</while>
<reply name="replyOutput" partnerLink="client"
portType="client:CFP15_while_pick" operation="process"
variable="outputVariable"/>
</sequence>
</process>
The semantics of “OR” when it is used in the condition of the <while> loop differs from
expected if a single identifier used in a Boolean Expression. As such, an expression
containing the variable MoreInstances of the Boolean type in the condition of the <while>
is not evaluated properly. According to the syntax of XPath a single identifier cannot be
taken as a Boolean expression. Therefore, the variable of an integer type or an
expression containing a relational operator should be used.
To make this example operational several types, messages, operations and partner links
were defined in the wsdl file as shown below:
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL
process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and us them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/CFP15_while_pick"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="CFP15_while_pickProcessRequest">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="CFP15_while_pickProcessStart">
<complexType>
<sequence>
68
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="CFP15_while_pickProcessFinish">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="CFP15_while_pickProcessNoMore">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="CFP15_while_pickProcessResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<message name="CFP15_while_pickRequestMessage">
<part name="payload"
element="client:CFP15_while_pickProcessRequest"/>
</message>
<message name="CFP15_while_pickStartMessage">
<part name="payload"
element="client:CFP15_while_pickProcessStart"/>
</message>
<message name="CFP15_while_pickFinishMessage">
<part name="payload"
element="client:CFP15_while_pickProcessFinish"/>
</message>
<message name="CFP15_while_pickNoMoreMessage">
<part name="payload"
element="client:CFP15_while_pickProcessNoMore"/>
</message>
<message name="CFP15_while_pickResponseMessage">
<part name="payload"
element="client:CFP15_while_pickProcessResponse"/>
</message>
69
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<plnk:partnerLinkType name="CFP15_while_pick">
<plnk:role name="CFP15_while_pickProvider">
<plnk:portType name="client:CFP15_while_pick"/>
</plnk:role>
<plnk:role name="CFP15_while_pickSender">
<plnk:portType name="client:CFP15_while_pick"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
An audit trail corresponding visualizing the execution history of the considered process
model is shown below:
receiveInput
[2005/08/10 15:58:00] Received "inputVariable" call from partner "client" More...
Assign_2
[2005/08/10 15:58:00] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP15_while_pickProcessResponse xmlns="http://xmlns.oracle.com/CFP15_while_pick">
70
<result>a</result>
</CFP15_while_pickProcessResponse>
</part>
</outputVariable>
[2005/08/10 15:58:00] Updated variable "Counter" More...
[2005/08/10 15:58:00] Updated variable "MoreInstances" More...
<while>
<pick>
Assign_1
[2005/08/10 15:59:31] Updated variable "Counter" More...
Assign_5
[2005/08/10 15:59:31] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP15_while_pickProcessResponse xmlns="http://xmlns.oracle.com/CFP15_while_pick">
<result>a.</result>
</CFP15_while_pickProcessResponse>
</part>
</outputVariable>
</sequence>
</onMessage>
</pick>
<pick>
onMessage (73)
[2005/08/10 15:59:31] Waiting for message from "client", operation is "noMore".
[2005/08/10 15:59:58] Received "noMore" callback from partner "client" More...
onMessage (65) (cancelled)
[2005/08/10 15:59:31] Waiting for message from "client", operation is "finish".
[2005/08/10 15:59:58] Receive activity has been cancelled.
onMessage (49) (cancelled)
[2005/08/10 15:59:31] Waiting for message from "client", operation is "start".
[2005/08/10 15:59:58] Receive activity has been cancelled.
<onMessage>
Assign_4
71
[2005/08/10 15:59:58] Updated variable "MoreInstances" More...
</onMessage>
</pick>
<pick>
Assign_3
[2005/08/10 16:00:27] Updated variable "Counter" More...
</onMessage>
</pick>
</while>
replyOutput (faulted)
[2005/08/10 16:00:27] "NullPointerException" has been thrown. less
java.lang.NullPointerException
</sequence>
[2005/08/10 16:00:27] "NullPointerException" has not been caught by a catch block.
[2005/08/10 16:00:27] BPEL process instance "241" cancelled
</process>
72
[2005/08/10 16:03:14] New instance of BPEL process "CFP15_while_pick" initiated (# "242").
<process>
<sequence>
receiveInput
[2005/08/10 16:03:14] Received "inputVariable" call from partner "client" More...
Assign_2
[2005/08/10 16:03:14] Updated variable "outputVariable" More...
[2005/08/10 16:03:14] Updated variable "Counter" More...
[2005/08/10 16:03:14] Updated variable "MoreInstances" More...
<while>
<pick>
onMessage (73)
[2005/08/10 16:03:15] Waiting for message from "client", operation is "noMore".
[2005/08/10 16:04:27] Received "noMore" callback from partner "client" More...
onMessage (65) (cancelled)
[2005/08/10 16:03:15] Waiting for message from "client", operation is "finish".
[2005/08/10 16:04:27] Receive activity has been cancelled.
onMessage (49) (cancelled)
[2005/08/10 16:03:15] Waiting for message from "client", operation is "start".
[2005/08/10 16:04:27] Receive activity has been cancelled.
<onMessage>
Assign_4
[2005/08/10 16:04:27] Updated variable "MoreInstances" More...
</onMessage>
</pick>
</while>
replyOutput (faulted)
[2005/08/10 16:04:27] "NullPointerException" has been thrown. More...
</sequence>
[2005/08/10 16:04:27] "NullPointerException" has not been caught by a catch block.
[2005/08/10 16:04:27] BPEL process instance "242" cancelled
</process>
Oracle BPEL PM supports this pattern directly by the <pick> construct, which allows only
one of several possible activities or (a set of activities) to be executed based on the type
of the message received. Alternatively, <pick> allows the time trigger to be specified for
the timeouts discarding all other alternative tasks. Figure 13 shows an example of a
73
process model with the deferred choice. Activities Assign_2 or Assign_3 are enabled if
the client provided a message "left" or "right" respectively. If none of these messages
had been received before the time alarm set for the third branch has expired, an activity
Assign_4 is executed.
The source code corresponding to the considered process model is shown below:
<process name="CFP16_pick_async"
targetNamespace="http://xmlns.oracle.com/CFP16_pick_async"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://xmlns.oracle.com/CFP16_pick_async"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"><!--
74
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:CFP16_pick_async"
myRole="CFP16_pick_asyncProvider"
partnerRole="CFP16_pick_asyncRequester"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation -->
<variable name="inputVariable"
messageType="client:CFP16_pick_asyncRequestMessage"/><!-- Reference to
the message that will be sent back to the
requester during callback
-->
<variable name="outputVariable"
messageType="client:CFP16_pick_asyncResponseMessage"/>
<variable name="OnMessage_left_InputVariable"
messageType="client:CFP16_pick_asyncLeftMessage"/>
<variable name="OnMessage_right_InputVariable"
messageType="client:CFP16_pick_asyncRightMessage"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP16_pick_async.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:CFP16_pick_async" operation="initiate"
variable="inputVariable" createInstance="yes"/><!-- Asynchronous
callback to the requester.
Note: the callback location and correlation id is transparently
handled
using WS-addressing.
-->
<pick name="Pick_1">
<onMessage portType="client:CFP16_pick_async" operation="left"
variable="OnMessage_left_InputVariable" partnerLink="client">
<assign name="Assign_2">
<copy>
75
<from
expression="concat(bpws:getVariableData('inputVariable','payload','/clie
nt:CFP16_pick_asyncProcessRequest/client:input'), 'Left')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP16_pick_asyncProcessResponse/client:result"/>
</copy>
</assign>
</onMessage>
<onMessage portType="client:CFP16_pick_async" operation="right"
variable="OnMessage_right_InputVariable" partnerLink="client">
<assign name="Assign_3">
<copy>
<from
expression="concat(bpws:getVariableData('inputVariable','payload','/clie
nt:CFP16_pick_asyncProcessRequest/client:input'), 'Right')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP16_pick_asyncProcessResponse/client:result"/>
</copy>
</assign>
</onMessage>
<onAlarm for="'PT2M'">
<assign name="Assign_4">
<copy>
<from
expression="concat(bpws:getVariableData('inputVariable','payload','/clie
nt:CFP16_pick_asyncProcessRequest/client:input'), 'Alarm')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP16_pick_asyncProcessResponse/client:result"/>
</copy>
</assign>
</onAlarm>
</pick>
<invoke name="callbackClient" partnerLink="client"
portType="client:CFP16_pick_asyncCallback" operation="onResult"
inputVariable="outputVariable"/>
</sequence>
</process>
The declarations of data types, messages, operations, and port types specified in the
WP16.wsdl file are shown below:
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL
process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and us them as part of the message types.
76
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/CFP16_pick_async"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="CFP16_pick_asyncProcessRequest">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="CFP16_pick_asyncProcessLeft">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="CFP16_pick_asyncProcessRight">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="CFP16_pick_asyncProcessResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<message name="CFP16_pick_asyncRequestMessage">
<part name="payload"
element="client:CFP16_pick_asyncProcessRequest"/>
</message>
<message name="CFP16_pick_asyncLeftMessage">
<part name="payload"
element="client:CFP16_pick_asyncProcessLeft"/>
</message>
<message name="CFP16_pick_asyncRightMessage">
77
<part name="payload"
element="client:CFP16_pick_asyncProcessRight"/>
</message>
<message name="CFP16_pick_asyncResponseMessage">
<part name="payload"
element="client:CFP16_pick_asyncProcessResponse"/>
</message>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- portType implemented by the CFP16_pick_async BPEL process -->
<portType name="CFP16_pick_async">
<operation name="initiate">
<input message="client:CFP16_pick_asyncRequestMessage"/>
</operation>
<operation name="left">
<input message="client:CFP16_pick_asyncLeftMessage"/>
</operation>
<operation name="right">
<input message="client:CFP16_pick_asyncRightMessage"/>
</operation>
</portType>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
the CFP16_pick_async partnerLinkType binds the provider and
requester portType into an asynchronous conversation.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<plnk:partnerLinkType name="CFP16_pick_async">
<plnk:role name="CFP16_pick_asyncProvider">
<plnk:portType name="client:CFP16_pick_async"/>
</plnk:role>
<plnk:role name="CFP16_pick_asyncSender">
<plnk:portType name="client:CFP16_pick_async"/>
</plnk:role>
<plnk:role name="CFP16_pick_asyncRequester">
<plnk:portType name="client:CFP16_pick_asyncCallback"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
78
An audit trail visualizing the execution history of the considered process is shown below.
This audit trail shows how the <pick> construct reacts on the message "right" received
from the client.
receiveInput
[2005/08/10 16:29:01] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP16_pick_asyncProcessRequest xmlns="http://xmlns.oracle.com/CFP16_pick_async">
<input>a</input>
</CFP16_pick_asyncProcessRequest>
</part>
</inputVariable>
<pick>
onMessage (42)
[2005/08/10 16:29:01] Waiting for message from "client", operation is "right".
[2005/08/10 16:29:22] Received "right" callback from partner "client" less
<OnMessage_right_InputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP16_pick_asyncProcessRight xmlns="http://xmlns.oracle.com/CFP16_pick_async">
<input>1</input>
</CFP16_pick_asyncProcessRight>
</part>
</OnMessage_right_InputVariable>
onMessage (34) (cancelled)
[2005/08/10 16:29:01] Waiting for message from "client", operation is "left".
[2005/08/10 16:29:22] Receive activity has been cancelled.
onAlarm (50) (cancelled)
[2005/08/10 16:29:01] Alarm started. Alarm will go off at time "2005/08/10 16:31:01".
[2005/08/10 16:29:22] BPEL "onAlarm" cancelled before being triggered.
<onMessage>
Assign_3
[2005/08/10 16:29:22] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP16_pick_asyncProcessResponse xmlns="http://xmlns.oracle.com/CFP16_pick_async">
<result>aRight</result>
</CFP16_pick_asyncProcessResponse>
</part>
</outputVariable>
</onMessage>
</pick>
callbackClient
79
[2005/08/10 16:29:22] Skipped callback "onResult" on partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP16_pick_asyncProcessResponse xmlns="http://xmlns.oracle.com/CFP16_pick_async">
<result>aRight</result>
</CFP16_pick_asyncProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 16:29:22] BPEL process instance "245" completed
</process>
This audit trail shows how the <pick> construct reacts on the message "left" received
from the client.
[2005/08/10 16:30:00] New instance of BPEL process "CFP16_pick_async" initiated (# "246").
<process>
<sequence>
receiveInput
[2005/08/10 16:30:00] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP16_pick_asyncProcessRequest xmlns="http://xmlns.oracle.com/CFP16_pick_async">
<input>b</input>
</CFP16_pick_asyncProcessRequest>
</part>
</inputVariable>
<pick>
Assign_2
[2005/08/10 16:30:20] Updated variable "outputVariable" less
<outputVariable>
80
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP16_pick_asyncProcessResponse xmlns="http://xmlns.oracle.com/CFP16_pick_async">
<result>bLeft</result>
</CFP16_pick_asyncProcessResponse>
</part>
</outputVariable>
</onMessage>
</pick>
callbackClient
[2005/08/10 16:30:20] Skipped callback "onResult" on partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP16_pick_asyncProcessResponse xmlns="http://xmlns.oracle.com/CFP16_pick_async">
<result>bLeft</result>
</CFP16_pick_asyncProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 16:30:20] BPEL process instance "246" completed
</process>
This audit trail shows how the <pick> construct behaves if no messages have been
provided by the client and the time alarm has expired.
[2005/08/10 16:31:29] New instance of BPEL process "CFP16_pick_async" initiated (# "247").
<process>
<sequence>
receiveInput
[2005/08/10 16:31:29] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP16_pick_asyncProcessRequest xmlns="http://xmlns.oracle.com/CFP16_pick_async">
<input>c</input>
</CFP16_pick_asyncProcessRequest>
</part>
</inputVariable>
<pick>
81
Assign_4
[2005/08/10 16:33:29] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP16_pick_asyncProcessResponse xmlns="http://xmlns.oracle.com/CFP16_pick_async">
<result>cAlarm</result>
</CFP16_pick_asyncProcessResponse>
</part>
</outputVariable>
</onAlarm>
</pick>
callbackClient
[2005/08/10 16:33:29] Skipped callback "onResult" on partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP16_pick_asyncProcessResponse xmlns="http://xmlns.oracle.com/CFP16_pick_async">
<result>cAlarm</result>
</CFP16_pick_asyncProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 16:33:29] BPEL process instance "247" completed
</process>
Although BPEL specification supports this pattern by means of the serializable scopes,
Oracle BPEL PM doesn’t seem to support it. Having two scopes placed on the
independent branches of the <flow> (see Figure 14) and setting in both scopes
variableAccessSerializable="yes", an access to the input variable should be exclusive.
However, as it is visualized in the audit trail, after one branch modified the value of the
input variable, the other branch is propagated the initial value of the input variable, but
not the newly assigned one, which is against the BPEL specification.
82
process (client)
flow-1
scope-1 scope-2
scope- scope-
1 2
<scope <scope
> >
assign-1 assign-3
'PT30S' 'PT30S'
assign-2 assign-4
0 0 0 0 0 0
process (client)
Figure 14 Interleaved parallel routing
83
The source code corresponding to the Figure 14 is shown below:
<sequence xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-
process/" name="main">
<!-- Receive input from requester.
Note: This maps to operation defined in WP17.wsdl
-->
<receive name="receiveInput" partnerLink="client" portType="tns:WP17"
operation="process" variable="input" createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<flow name="flow-1">
<sequence name="flow-sequence-1"><scope name="scope-1"
variableAccessSerializable="yes"><sequence name="sequence-1"><assign
name="assign-1">
<copy>
<from expression=""Start left""></from>
<to variable="input" part="payload"
query="/tns:WP17Request"/>
</copy>
</assign>
<wait for="'PT30S'" name="wait-1"/>
<assign name="assign-2">
<copy>
<from expression=""End left""></from>
<to variable="input" part="payload"
query="/tns:WP17Request"/>
</copy>
</assign>
</sequence>
</scope>
</sequence>
<sequence name="flow-sequence-2"><scope name="scope-2"
variableAccessSerializable="yes"><sequence><assign name="assign-3">
<copy>
<from expression=""Start right""></from>
<to variable="input" part="payload"
query="/tns:WP17Request"/>
</copy>
</assign>
<wait for="'PT30S'" name="wait-2"/>
<assign name="assign-4">
<copy>
<from expression=""End right""></from>
<to variable="input" part="payload"
query="/tns:WP17Request"/>
</copy>
</assign>
</sequence>
</scope>
</sequence>
</flow>
<reply name="replyOutput" partnerLink="client" portType="tns:WP17"
operation="process" variable="output"/>
</sequence>
84
An audit trail showing the execution history of the considered process is given below:
client (process)
[2005/07/13 17:31:28] Received "input" call from partner "client" More...
<flow>
<sequence>
<scope name="scope-1">
<sequence>
assign-3
[2005/07/13 17:31:28] Updated variable "input" Less
<input>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<WP17Request xmlns="http://acm.org/samples">
<input>start</input>
Start right
</WP17Request>
</part>
</input>
2005.07.13 05:31
[2005/07/13 17:31:28] Waiting for the expiry time "7/13/05 5:31 PM".
[2005/07/13 17:31:58] Wait has finished.
assign-4
[2005/07/13 17:31:58] Updated variable "input" Less
<input>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<WP17Request xmlns="http://acm.org/samples">
<input>start</input>
End right
</WP17Request>
</part>
</input>
</sequence>
<scope>
</sequence>
<sequence>
<scope name="scope-1">
<sequence>
assign-1
[2005/07/13 17:31:28] Updated variable "input" Less
<input>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<WP17Request xmlns="http://acm.org/samples">
<input>start</input>
85
Start left
</WP17Request>
</part>
</input>
2005.07.13 05:31
[2005/07/13 17:31:28] Waiting for the expiry time "7/13/05 5:31 PM".
[2005/07/13 17:31:58] Wait has finished.
assign-2
[2005/07/13 17:31:58] Updated variable "input" Less
<input>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<WP17Request xmlns="http://acm.org/samples">
<input>start</input>
End left
</WP17Request>
</part>
</input>
</sequence>
<scope>
</sequence>
</flow>
client
[2005/07/13 17:31:58] Reply to partner "client". Less
<output>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<WP17Response xmlns="http://acm.org/samples" />
</part>
</output>
</sequence>
[2005/07/13 17:31:58] BPEL process instance "1304" completed
</process>
CFP18 Milestone
Description: A given activity E can only be enabled if a certain milestone has been
reached which has not yet expired. A milestone is defined as a point in the process
where a given activity A has finished and an activity B following it has not yet started.
Oracle BPEL PM does not offer a direct support for this pattern in terms of the single
activity, but the workaround can be found by means of the <pick> construct placed in the
<while> loop, which can be executed only once (see Figure 15). When executing this
process model, the client specifies whether the activity E or an activity B is to be
executed. If the message onE has been received, then the activity E, i.e. actE, followed
by the activity B, i.e. <reply>, is executed. Otherwise, if the message onB has been
received, the activity B (<reply>) will be executed and the activity E won’t be able to
execute any more. Each of the branches in the <pick> construct contains the assignment
activity, which is needed for updating the loop counter.
86
Figure 15 Milestone
The source code corresponding to the process visualized in Figure 15 is given below:
<sequence xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-
process/" name="main">
<!-- Receive input from requester.
Note: This maps to operation defined in Milestone.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="tns:Milestone" operation="process" variable="input"
createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<assign name="actA">
<copy>
<from expression="false()"></from>
<to variable="B_chosen"/>
87
</copy>
</assign>
<while name="while-1"
condition="not(bpws:getVariableData('B_chosen'))"><pick name="pick-1">
<onMessage partnerLink="client" portType="tns:Milestone"
operation="onE" variable="E_var">
<sequence><assign name="assign-3">
<copy>
<from expression="true()"></from>
<to variable="B_chosen"/>
</copy>
</assign>
<empty name="actE"/>
</sequence>
</onMessage>
<onMessage partnerLink="client" portType="tns:Milestone"
operation="onB" variable="B_var">
<assign name="assign-2">
<copy>
<from expression="true()"></from>
<to variable="B_chosen"/>
</copy>
</assign>
</onMessage>
</pick>
</while>
<reply name="replyOutput" partnerLink="client"
portType="tns:Milestone" operation="process" variable="output"/>
</sequence
The declaration of data types, messages, port types and partner links are shown below:
<?xml version="1.0"?>
<definitions name="Milestone"
targetNamespace="http://acm.org/samples"
xmlns:tns="http://acm.org/samples"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
><!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of types participating in this BPEL process
The BPEL Designer will generate default request and response types
but you can define or import any XML Schema type and use them as
part
of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://acm.org/samples"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="MilestoneRequest">
<complexType>
<sequence>
88
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="MilestoneResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
<element name="MilestoneSend">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<message name="MilestoneRequestMessage">
<part name="payload" element="tns:MilestoneRequest"/>
</message>
<message name="MilestoneResponseMessage">
<part name="payload" element="tns:MilestoneResponse"/>
</message>
<message name="MilestoneEMessage">
<part name="payload" element="tns:MilestoneSend"/>
</message>
<message name="MilestoneBMessage">
<part name="payload" element="tns:MilestoneSend"/>
</message>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<!-- portType implemented by the Milestone BPEL process -->
<portType name="Milestone">
<operation name="process">
<input message="tns:MilestoneRequestMessage" />
<output message="tns:MilestoneResponseMessage"/>
</operation>
<operation name="onE">
<input message="tns:MilestoneEMessage"/>
</operation>
<operation name="onB">
89
<input message="tns:MilestoneBMessage"/>
</operation>
</portType>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<plnk:partnerLinkType name="Milestone">
<plnk:role name="MilestoneProvider">
<plnk:portType name="tns:Milestone"/>
</plnk:role>
<plnk:role name="MilestoneSender">
<plnk:portType name="tns:MilestoneSend"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
An audit trail visualizing the execution history of the considered process is shown below:
client (process)
[2005/07/11 14:12:24] Received "input" call from partner "client" More...
actA
[2005/07/11 14:12:24] Updated variable "B_chosen" More...
<while>
<pick>
assign-3
[2005/07/11 14:12:31] Updated variable "B_chosen" More...
90
Empty
[2005/07/11 14:12:31] BPEL "empty" activity is executed.
</sequence>
</onMessage>
</pick>
</while>
client
[2005/07/11 14:12:31] Reply to partner "client". More...
</sequence>
[2005/07/11 14:12:31] BPEL process instance "1209" completed
</process>
Not that the offered solution is very specific and does not allow other types of the
milestone to be supported.
91
Figure 16 Milestone- the alternative implementation
92
<process name="CFP18_while_wait"
targetNamespace="http://xmlns.oracle.com/CFP18_while_wait"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20" xmlns:ns1="http://www.w3.org/2001/XMLSchema"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://xmlns.oracle.com/CFP18_while_wait"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"><!--
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:CFP18_while_wait"
myRole="CFP18_while_waitProvider"
partnerRole="CFP18_while_waitRequester"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation --><!-- Reference to the message that will be sent back to
the
requester during callback
-->
<variable name="inputVariable"
messageType="client:CFP18_while_waitRequestMessage"/>
<variable name="outputVariable"
messageType="client:CFP18_while_waitResponseMessage"/>
<variable name="Milestone" type="ns1:boolean"/>
<variable name="FlowN_1_Variable" type="xsd:int"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in CFP18_while_wait.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:CFP18_while_wait" operation="initiate"
93
variable="inputVariable" createInstance="yes"/><!-- Asynchronous
callback to the requester.
Note: the callback location and correlation id is transparently
handled
using WS-addressing.
-->
<assign name="Assign_1">
<copy>
<from expression="false()"/>
<to variable="Milestone"/>
</copy>
<copy>
<from variable="inputVariable" part="payload"
query="/client:CFP18_while_waitProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:CFP18_while_waitProcessResponse/client:result"/>
</copy>
</assign>
<flow name="Flow_1">
<sequence name="Sequence_2">
<bpelx:flowN name="FlowN_1" N="3"
indexVariable="FlowN_1_Variable">
<sequence name="Sequence_3">
<while name="While_1"
condition="bpws:getVariableData('Milestone') = false()">
<wait name="Wait_1" for="'PT1S'"/>
</while>
<assign name="Assign_4">
<copy>
<from
expression="concat(bpws:getVariableData('outputVariable','payload','/cli
ent:CFP18_while_waitProcessResponse/client:result'), '.')"/>
<to variable="outputVariable" part="payload"
query="/client:CFP18_while_waitProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
</bpelx:flowN>
</sequence>
<sequence name="Sequence_1">
<assign name="Assign_2">
<copy>
<from expression="true()"/>
<to variable="Milestone"/>
</copy>
</assign>
<wait name="Wait_2" for="'PT10S'"/>
<assign name="Assign_3">
<copy>
<from expression="false()"/>
<to variable="Milestone"/>
</copy>
</assign>
</sequence>
</flow>
94
<invoke name="callbackClient" partnerLink="client"
portType="client:CFP18_while_waitCallback" operation="onResult"
inputVariable="outputVariable"/>
</sequence>
</process>
The wsdl code associated with the considered process model is given below:
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<message name="CFP18_while_waitRequestMessage">
<part name="payload"
element="client:CFP18_while_waitProcessRequest"/>
</message>
95
<message name="CFP18_while_waitResponseMessage">
<part name="payload"
element="client:CFP18_while_waitProcessResponse"/>
</message>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- portType implemented by the CFP18_while_wait BPEL process -->
<portType name="CFP18_while_wait">
<operation name="initiate">
<input message="client:CFP18_while_waitRequestMessage"/>
</operation>
</portType>
An audit trail demonstrating the execution history of the considered process is shown
below:
receiveInput
[2005/08/10 16:49:50] Received "inputVariable" call from partner "client" less
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
96
<CFP18_while_waitProcessRequest xmlns="http://xmlns.oracle.com/CFP18_while_wait">
<input>a</input>
</CFP18_while_waitProcessRequest>
</part>
</inputVariable>
Assign_1
[2005/08/10 16:49:50] Updated variable "Milestone" less
<Milestone>false</Milestone>
[2005/08/10 16:49:50] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP18_while_waitProcessResponse xmlns="http://xmlns.oracle.com/CFP18_while_wait">
<result>a</result>
</CFP18_while_waitProcessResponse>
</part>
</outputVariable>
<flow>
<sequence>
Assign_2
[2005/08/10 16:49:50] Updated variable "Milestone" less
<Milestone>true</Milestone>
Wait_2
[2005/08/10 16:49:50] Waiting for the expiry time "2005/08/10 16:50:00".
[2005/08/10 16:50:00] Wait has finished.
Assign_3
[2005/08/10 16:50:00] Updated variable "Milestone" less
<Milestone>false</Milestone>
</sequence>
<sequence>
<flowN>
<FlowN_1_Variable=0>
<sequence>
<while>
</while>
Assign_4
[2005/08/10 16:49:50] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP18_while_waitProcessResponse xmlns="http://xmlns.oracle.com/CFP18_while_wait">
<result>a..</result>
</CFP18_while_waitProcessResponse>
</part>
</outputVariable>
</sequence>
</FlowN_1_Variable=0>
<FlowN_1_Variable=1>
97
<sequence>
<while>
</while>
Assign_4
[2005/08/10 16:49:50] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP18_while_waitProcessResponse xmlns="http://xmlns.oracle.com/CFP18_while_wait">
<result>a...</result>
</CFP18_while_waitProcessResponse>
</part>
</outputVariable>
</sequence>
</FlowN_1_Variable=1>
<FlowN_1_Variable=2>
<sequence>
<while>
</while>
Assign_4
[2005/08/10 16:49:50] Updated variable "outputVariable" less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP18_while_waitProcessResponse xmlns="http://xmlns.oracle.com/CFP18_while_wait">
<result>a.</result>
</CFP18_while_waitProcessResponse>
</part>
</outputVariable>
</sequence>
</FlowN_1_Variable=2>
</flowN>
</sequence>
</flow>
callbackClient
[2005/08/10 16:50:00] Skipped callback "onResult" on partner "client". less
<outputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<CFP18_while_waitProcessResponse xmlns="http://xmlns.oracle.com/CFP18_while_wait">
<result>a...</result>
</CFP18_while_waitProcessResponse>
</part>
</outputVariable>
</sequence>
[2005/08/10 16:50:00] BPEL process instance "249" completed
</process>
98
CFP19 Cancel Activity
Description: A cancel activity terminates a running instance of an activity.
An Oracle BPEL PM provides support for this pattern by means of using a scope as
wrapper for an activity that should be canceled (see Figure 17), defining a fault that must
be thrown when the client cancels the activity (see Figure 19) and the fault handler to
catch this fault message (see Figure 18).
99
Figure 19 Throw fault
The process model of the canceling a wait activity PT1H is shown in Figure 17, while the
corresponding source code is shown below:
100
<!-- Reference to the message passed as input during
initiation -->
<variable name="input"
messageType="tns:TestCancelActivityRequestMessage"/>
<!-- Reference to the message that will be sent back to the
requester during callback
-->
<variable name="output"
messageType="tns:TestCancelActivityResponseMessage"/>
<variable name="ca"
messageType="tns:TestCancelActivityCAMessage"/>
</variables>
<!--
================================================================= -->
<!-- ORCHESTRATION LOGIC
-->
<!-- Set of activities coordinating the flow of messages across
the -->
<!-- services integrated within this business process
-->
<!--
================================================================= -->
<sequence name="main">
<!-- Receive input from requestor.
Note: This maps to operation defined in
TestCancelActivity.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="tns:TestCancelActivity" operation="initiate" variable="input"
createInstance="yes"/>
<!-- Asynchronous callback to the requester.
Note: the callback location and correlation id is
transparently handled
using WS-addressing.
-->
<flow name="flow-1">
<sequence name="flow-sequence-1"><scope name="scope-
1"><faultHandlers>
<catch faultName="wrongValue"><empty
name="empty-1"/>
</catch>
</faultHandlers>
<eventHandlers>
<onMessage partnerLink="client"
portType="tns:TestCancelActivity" operation="onCA" variable="ca">
<throw name="throw-1"
faultName="wrongValue"/>
</onMessage>
</eventHandlers>
<wait for="PT1H" name="wait-2"/>
</scope>
</sequence>
<sequence name="flow-sequence-2"><wait for="'PT10M'"
name="wait-1"/>
</sequence>
</flow>
101
<invoke name="callbackClient" partnerLink="client"
portType="tns:TestCancelActivityCallback" operation="onResult"
inputVariable="output"/>
</sequence>
</process>
Declarations of the data types, messages, partner links and port types are shown below:
<?xml version="1.0"?>
<definitions name="TestCancelActivity"
targetNamespace="http://acm.org/samples"
xmlns:tns="http://acm.org/samples"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL
process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and us them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://acm.org/samples"
xmlns="http://www.w3.org/2001/XMLSchema"
>
<element name="TestCancelActivityRequest">
<complexType>
<sequence>
<element name="input" type="string" />
</sequence>
</complexType>
</element>
<element name="TestCancelActivityResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
<element name="TestCancelActivityCA">
<complexType>
<sequence>
<element name="ca" type="string"/>
</sequence>
</complexType>
</element>
102
</schema>
</types>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<message name="TestCancelActivityRequestMessage">
<part name="payload" element="tns:TestCancelActivityRequest"/>
</message>
<message name="TestCancelActivityResponseMessage">
<part name="payload" element="tns:TestCancelActivityResponse"/>
</message>
<message name="TestCancelActivityCAMessage">
<part name="payload" element="tns:TestCancelActivityCA"/>
</message>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<!-- portType implemented by the TestCancelActivity BPEL process -->
<portType name="TestCancelActivity">
<operation name="initiate">
<input message="tns:TestCancelActivityRequestMessage"/>
</operation>
</portType>
<portType name="TestCancelActivity">
<operation name="onCA">
<input message="tns:TestCancelActivityCAMessage"/>
</operation>
</portType>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103
PARTNER LINK TYPE DEFINITION
the TestCancelActivity partnerLinkType binds the provider and
requester portType into an asynchronous conversation.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<plnk:partnerLinkType name="TestCancelActivity">
<plnk:role name="TestCancelActivityProvider">
<plnk:portType name="tns:TestCancelActivity"/>
</plnk:role>
<plnk:role name="TestCancelActivityRequester">
<plnk:portType name="tns:TestCancelActivityCallback"/>
</plnk:role>
<plnk:role name="TestCancelActivityCAer">
<plnk:portType name="tns:TestCancelActivityCAPT"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
client (initiate)
[2005/07/15 11:04:44] Received "input" call from partner "client" More...
<flow>
<sequence>
Throw (faulted)
[2005/07/15 11:04:58] "{http://acm.org/samples}wrongValue" has been thrown. Less
<wrongValue xmlns="http://acm.org/samples" />
</onMessage>
</eventHandlers>
Empty
104
[2005/07/15 11:04:58] BPEL "empty" activity is executed.
</catchFault>
<scope>
</sequence>
Oracle BPEL PM supports this pattern directly by means of the <terminate> construct.
The execution of the <terminate> activity leads to canceling of the whole process
instance.
<sequence xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-
process/" name="main">
<!-- Receive input from requestor.
Note: This maps to operation defined in WP20.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="tns:WP20" operation="initiate" variable="input"
createInstance="yes"/>
<!-- Asynchronous callback to the requester.
105
Note: the callback location and correlation id is
transparently handled
using WS-addressing.
-->
<flow name="flow-1">
<sequence name="flow-sequence-1"><wait for="PT1H"
name="wait-1"/>
<empty name="ActA"/>
</sequence>
<sequence name="flow-sequence-2"><terminate name="terminate-
1"/>
</sequence>
</flow>
<invoke name="callbackClient" partnerLink="client"
portType="tns:WP20Callback" operation="onResult"
inputVariable="output"/>
</sequence>
An audit trail visualizing the execution history of the considered process is shown below:
client (initiate)
[2005/07/13 17:47:19] Received "input" call from partner "client" More...
<flow>
<sequence>
Terminate
[2005/07/13 17:47:19] Instance terminated.
<sequence>
106
2. Evaluation of Oracle BPEL PM from the data
perspective
Data visibility
DP 1 (Task Data)
Description: Data elements can be defined by tasks which are accessible only within the
context of individual execution instances of that task.
Oracle BPEL PM offers no direct support for this pattern. However, it can be
accomplished through the <scope> construct. The <scope> is a collection of activities
that can have its own local variables. The number of nested activities into a scope
defines the visibility of data, i.e. if a scope contains only one task, then a variable defined
within this scope will be visible only to this task but not to the higher levels.
Figure 21, Figure 22 and Figure 23 show how to declare variables local to a task via the
properties of the <scope>.
107
Figure 22 <scope>: create variables
The source code associated with a process definition contains the section for declaration
of variables, as it is shown below. Note that on the process scope level, any variable is
treated as global, i.e. it is visible to all process components.
108
<variables>
<!-- Reference to the message passed as input during initiation -->
<variable name="input" messageType="tns:TestDataRequestMessage"/>
<!--
Reference to the message that will be returned to the requester-->
<variable name="output" messageType="tns:TestDataResponseMessage"/>
<variable name="testlocalvar" type="xsd:date"/>
<variable name="testglobalvar" type="xsd:dateTime"/>
</variables>
To define a variable local to a scope, the declaration of the data variable should be
performed in the boundaries of the <scope>.
DP 2 (Block Data)
Description: Block tasks (i.e. tasks which can be described in terms of a corresponding
sub-workflow) are able to define data elements which are accessible by each of the
components of the corresponding sub-workflow.
Oracle BPEL PM: does not have a notion of a sub-workflow, it does not allow unfolding a
block task to another process model, but is oriented towards web services. Therefore this
pattern is not supported.
DP 3 (Scope Data)
Description: Data elements can be defined which are accessible by a subset of the tasks
in a case.
Oracle BPEL PM supports this pattern directly. The process designer offers the <scope>
construct which encompasses several tasks in the hierarchical manner. The data
variables declared within the <scope> are visible and shared between all scope
components.
Oracle BPEL PM supports this pattern partially. MI task without synchronization, when
the number of instances is known at the design time, may have data variables associated
with every separate task instance. Every task instance the parameter createInstance of
which is set to yes has a distinct se of data elements. Every activity instantiated in this
109
way operates in its own address space. MI with synchronization, the number of instances
of which is known at the design time, also may have data variables local to every
instance. However this imposes the constraint that every task instance must be wrapped
into the <scope>. MI task with synchronization, the number of instances of which is
known at the run-time, is realized in Oracle BPEL PM by means of the <flowN>
construct. On the one hand, the semantics of <flowN> is not specified and this construct
is Oracle-specific. On the other hand the result of testing showed that all instances of the
task that were created run-time share all data variables, thus are not instance-specific.
DP 5 (Case Data)
Description: Data elements are supported which are specific to a process instance or a
workflow case. They can be accessed by all components of the workflow during the
execution of the case.
Oracle BPEL PM supports this pattern by means of declaring data variables in the
uppermost (process) scope. The declaration can be done directly in the source code of
the process bpel source, as it is shown in Figure 24, or with the help of the graphical
interface in the designer editor as it is shown in Figure 25.
110
Figure 25 Data declaration wizard
DP 6 (Folder Data)
Description: Data elements can be defined which are accessible by multiple cases on a
selective basis.
DP 7 (Workflow Data)
Description: Data elements are supported which are accessible to all components in
each and every case of the workflow and are within the control of the workflow system.
Oracle BPEL PM supports this pattern by means of preference properties that are
defined in the deployment descriptor. Preferences are name-value properties that are
accessed at run time by BPEL process. It allows changing the value of preferences
without having to redeploy the BPEL process.
111
Figure 26 Deployment descriptor properties
An access to the preference property set in Figure 26 and its value are shown in the audit
trail below.
112
DP 8 (Environment Data)
Description: Data elements which exist in the external operating environment are able to
be accessed by components of the workflow during execution.
<variable name="inputToCr"
messageType="nsxml0:CreditRatingServiceRequestMessage"/>
<variable name="outputFromCr"
messageType="nsxml0:CreditRatingServiceResponseMessage"/>
...
<invoke name="invoke-1" operation="process" inputVariable="inputToCr"
outputVariable="outputFromCr" partnerLink="CreditRatingService"
portType="nsxml0:CreditRatingService"/>
Note that the data types, message types and port types need to be defined in the wsdl
format:
113
<?xml version="1.0"?>
<definitions name="TestMIwithoutSync"
targetNamespace="http://acm.org/samples"
xmlns:tns="http://acm.org/samples"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of types participating in this BPEL process
The BPEL Designer will generate default request and response types
but you can define or import any XML Schema type and use them as
part
of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://acm.org/samples"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="TestMIwithoutSyncRequest">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="TestMIwithoutSyncResponse">
<complexType>
<sequence>
<element name="result" type="integer"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<message name="TestMIwithoutSyncRequestMessage">
<part name="payload" element="tns:TestMIwithoutSyncRequest"/>
</message>
<message name="TestMIwithoutSyncResponseMessage">
<part name="payload" element="tns:TestMIwithoutSyncResponse"/>
</message>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
114
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<!-- portType implemented by the TestMIwithoutSync BPEL process -->
<portType name="TestMIwithoutSync">
<operation name="process">
<input message="tns:TestMIwithoutSyncRequestMessage" />
<output message="tns:TestMIwithoutSyncResponseMessage"/>
</operation>
</portType>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<plnk:partnerLinkType name="TestMIwithoutSync">
<plnk:role name="TestMIwithoutSyncProvider">
<plnk:portType name="tns:TestMIwithoutSync"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
Oracle BPEL PM adopts “no data passing” strategy, i.e. the flow of control is passed from
one task to another, but the control-flow channel is not integrated with a data channel,
nor there is a private data channel connecting tasks. Data within the same case are not
passed between tasks but are made available via access to globally shared data.
An access to the data variables is accomplished via the <assign> activity. The <assign>
activity allows the definition of Copy Rules based on the XPATH Query in order to assign
a value of a variable, a part or a query (see Figure 27).
115
Figure 27 Assign activity
Not applicable, since the concept of the Block task, which can be unfolded to a sub-
workflow, is not supported.
Not applicable, since the concept of the Block task, which can be unfolded to a sub-
workflow, is not supported.
116
Since not all variants of MI task are supported by Oracle BPEL PM, this patterns is
respectively not supported directly. It is possible to pass data to all instances or to a
specific instance of the MI task without synchronization. The same is valid for multiple
instances task with synchronization created at the design-time. In addition, arrays of data
can be used for passing data to specific task instances.
Since multiple instances are not supported directly, this pattern is also not directly
supported. However for the existing workarounds to implement MI task, the specified
number of instances must complete before data can be passed to the subsequent task
by means of the <assign> construct. In order to keep track of data associated with task
instances created run-time (with or without a-priori knowledge) the array structure can be
used. Any of the array elements can be passed to the subsequent task.
Oracle BPEL PM supports this pattern directly by via the <invoke> construct, which
allows passing data by means of the referencing to the variable name in the
inputVariable attribute on an asynchronous basis.
<variable name="output"
messageType="tns:TestMultiChoiceResponseMessage"/>
The corresponding message type, operation, and port type are defined in the wsdl as
follows:
<?xml version="1.0"?>
<definitions name="TestMultiChoice"
targetNamespace="http://acm.org/samples"
xmlns:tns="http://acm.org/samples"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
117
>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL
process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and us them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://acm.org/samples"
xmlns="http://www.w3.org/2001/XMLSchema"
>
<element name="TestMultiChoiceRequest">
<complexType>
<sequence>
<element name="input" type="string" />
</sequence>
</complexType>
</element>
<element name="TestMultiChoiceResponse">
<complexType>
<sequence>
<element name="result1" type="string"/>
<element name="result2"
type="string"/>
<element name="result3"
type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
>
<message name="TestMultiChoiceRequestMessage">
<part name="payload" element="tns:TestMultiChoiceRequest"/>
</message>
<message name="TestMultiChoiceResponseMessage">
<part name="payload" element="tns:TestMultiChoiceResponse"/>
</message>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
118
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- portType implemented by the TestMultiChoice BPEL process -->
<portType name="TestMultiChoice">
<operation name="initiate">
<input message="tns:TestMultiChoiceRequestMessage"/>
</operation>
</portType>
Oracle BPEL PM supports this pattern directly by means of <invoke> and <receive>
synchronously. The <invoke> activity invokes an external service, and waits for its reply
via <receive>. The invoked service must have <reply> implemented in order to send the
requested data back.
For instance, the code below shows the invocation of an external service
CreditRatingService. The crInput variable provides an input data needed for the service
invocation, the result provided by the service is associated with the output variable
respectively.
119
Where an external service has been declared by means of the partner link:
<partnerLink name="CreditRatingService"
partnerLinkType="nsxml0:CreditRatingService"
partnerRole="CreditRatingServiceProvider"/>
Oracle BPEL PM supports this pattern directly by means of <receive> and event
handlers (onMessage within the <pick> construct) as it is shown below in the code
snippets.
Oracle BPEL PM supports this pattern directly by means of <receive> and <reply>
constructs.
120
DP 22 (Data Interaction- Case to Environment- Pull-Oriented)
Description: The ability of a workflow case to respond to requests for data elements from
a service or resource in the operating environment.
Oracle BPEL PM supports this pattern directly by means of the <assign> activity.
Oracle BPEL PM supports this pattern directly by means of the <assign> activity.
121
DP 29 (Data Transfer- Copy In/Copy Out)
Description: The ability of a workflow component to copy the values of a set of data
elements into its address space at the commencement of execution and to copy their
final values back at completion.
This pattern assumes that the entire data needs to migrate from one task to another.
Oracle BPEL PM offers no support for this pattern, since it allows only copying data from
one task to another by means of an <assign> activity, which is not applicable for data
migration.
Oracle BPEL PM supports this pattern directly. No concurrency restrictions apply to the
shared data.
Although Oracle BPEL PM can indirectly support this pattern by means of serializable
scopes, the tested version of Oracle BPEL PM does not seem to work according to the
semantics of the serializable scopes.
Although Oracle BPEL PM allows the usage of the transformation functions within the
<assign> activity, this pattern understands the transformations as inline functions which
must occur at the time the task initiated. Therefore, this pattern is not supported.
Oracle BPEL PM does not support this pattern since it is not possible to specify
transformation function inline with the task, which would be applied on the task
completion.
122
Data-based Routing
Oracle BPEL PM supports this pattern by means of links and conditions evaluating the
status of the links, i.e. joinCondition. For instance, assuming that sources of links L1 and
L2 have been defined, an empty activity will be executed after the status of the links has
been evaluated and joinCondition satisfied.
Oracle BPEL PM supports this pattern directly by means of <receive> and event
handlers onMessage. In addition, there is also support for the time events via onAlarm.
DP 40 (Data-based Routing)
Description: The ability to alter the control flow within a workflow case as a consequence
of the value of data-based expressions.
123
Oracle BPEL PM offers direct support for this pattern via links and the <switch>
construct. Every link can have a data-based transition condition associated with it, and
thus be selected if the given transition condition has been satisfied. The <switch>
construct allows creating multiple branches and their association with the data
conditions. The first branch specified in the lexical order, for which the data conditions
holds, is to be selected. An example of the <switch> construct with two predefined and
one default conditions is shown below:
<switch name="switch-1">
<case
condition="bpws:getVariableData("input","payload",&q
uot;/tns:TestExclusiveChoiceRequest/tns:input")<5;">
<sequence>
<assign name="actA">
<copy>
<from variable="input" part="payload"
query="/tns:TestExclusiveChoiceRequest/tns:input">
</from>
<to variable="output" part="payload"
query="/tns:TestExclusiveChoiceResponse/tns:result"/>
</copy>
</assign>
</sequence>
</case>
<otherwise>
<sequence>
<assign name="actB">
<copy>
<from variable="input" part="payload"
query="/tns:TestExclusiveChoiceRequest/tns:input">
</from>
<to variable="output" part="payload"
query="/tns:TestExclusiveChoiceResponse/tns:result"/>
</copy>
</assign>
</sequence>
</otherwise>
</switch>
124
3. Evaluation of Oracle BPEL PM from the resource
perspective
The evaluation of Oracle BPEL PM from the resource perspective is based on the
features of the Workflow Service offered by Oracle BPEL PM to model user interactions.
The user task can be added in the process model by means of the user task macro
block, which allows the given task to be configured and the functionality of which
depends on the set of services, namely Task Management Service, Task Action Handler,
Idenitity Service, Worklist Service, Task Routing Service and Notification Service. The
main purpose of the user task service is to enable the integration of people and manual
tasks into bpel flows.
A user task is a service that assists with modeling processes that require user input in
order to complete. It is accessible externally through a Java API upon which custom
interfaces may be developed. Typically in a process that requires user input, an
upstream process element creates a User Task and associates a payload of data with it;
subsequently suspending downstream process nodes. That task and its associated data
may then be accessed through an external application's user interface. Once the user
has completed the required external process, the User Task API is called to assign a
status of complete (or any other appropriate value). This in turn activates the remaining
downstream processes. User tasks are special instances of activities where the
performer of the activity is manual rather than automated. Tasks may be assigned to
particular assignees and may have expiration times associated with them [13].
A task may be routed through multiple users via a sequential flow, a parallel flow, or an
adhoc flow. Oracle BPEL PM integrated these routing variants into a set of "workflow
patterns" (see Figure 28) consisting of
- Simple workflow (single-user task) – used for a business process that required a
user's action. Based on the user's action or inaction, the business process
modeler defines what the business process has to do.
- Simple workflow with escalation (extension of a single-user task) – used to
escalate the task, if the user does not respond within the allotted time.
- Simple workflow with renewal (extension of a single-user task) – used to extend
the expiration period id the user doe not respond within the allotted time.
- Sequential workflow – used to route tasks to multiple users in sequence.
- Sequential workflow with escalation (extension of a sequential workflow) – used
to escalate the task if a user does not take an action within the allotted time.
- Parallel workflow – used when multiple users, working in parallel, must take
action, such as in a hiring situation when multiple users vote to hire or reject an
applicant. The voting percentage is needed for specifying the outcome.
- Parallel workflow with final reviewer (extension of parallel workflow) – used
when a task is first sent to multiple users in parallel and then sent to a final
reviewer for a decision.
- Adhoc (or dynamic) workflow – used to assign a task to one user first, who then
decides where the task goes next. The task is routed until one of the assignees
completes it.
- FYI task – used when a task is sent to the user, but the business process does
not wait for the user response.
- User task 2.0. Macro – supports user tasks from Oracle BPEL PM release 2.0.
125
- Task continuation – used to build complex workflow patterns, i.e. it allows one
workflow to be continued with another workflow.
Each of the workflow patterns can be easily configured with help of the workflow wizard.
Figures below show an example of configuring the Simple workflow pattern.
126
Figure 30 Workflow wizard - Step 3
127
Figure 32 Workflow wizard - Step 5
128
Figure 34 Workflow wizard - Step 7
129
Figure 36 Workflow wizard - Step 9
130
Figure 38 Workflow wizard - Step 11
Users access tasks assigned to them via the Worklist Application, which displays tasks
assigned to the user, the group the user belongs to, and allows including additional
information such as history, comment, etc. Any user may adjust the format of a work list
in order to display the work items allocated to this user, to the group the user belongs to,
or other users. By selecting a work item allocated to a user, the user may commence
execution on it. An example of work list is shown in Figure 39.
131
Figure 39 The worklist application
The evaluation of Oracle BPEL PM from the resource perspective is done by means of
the resource patterns [10]. The pattern can be directly or partially supported or not
supported at all. The criteria for the evaluation are taken from [10].
Oracle BPEL PM supports this pattern directly. The resources can be specified statically
or dynamically. The organization structure, together with resources, their identities, and
other characteristics can be specified via JAZN admintool. When adding a task to the
process model, the workflow wizard allows specifying a single user, a set of the users, or
a group as it shown in Figure 41. Each of the task parameters specified by means of the
wizard can be modified later in the designer view (SimpleUserActivity1 in Figure 40) or in
the corresponding BPEL code.
132
Figure 40 A user task (Simple Workflow pattern)
133
An identity look-up dialog by role and user is shown in Figure 42 and respectively.
The code snippets corresponding to the process model in Figure 40 are shown below:
134
<process name="RP1_jazn"
targetNamespace="http://xmlns.oracle.com/RP1_jazn"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.Xpath20"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:client="http://xmlns.oracle.com/RP1_jazn"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:identityservice="http://xmlns.oracle.com/pcbpel/identityservice/lo
cal"
xmlns:taskmngr="http://xmlns.oracle.com/pcbpel/taskservice/taskmanager"
xmlns:taskroutingservice="http://xmlns.oracle.com/pcbpel/taskservice/tas
kroutingservice" xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:task="http://xmlns.oracle.com/pcbpel/taskservice/task"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.servi
ces.functions.ExtFunc"
xmlns:taskactionhandler="http://xmlns.oracle.com/pcbpel/taskservice/task
ActionHandler"><!--
================================================================= --><!-
- PARTNERLINKS --
><!-- List of services participating in this BPEL process
--><!--
================================================================= -->
<partnerLinks><!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information
associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:RP1_jazn"
myRole="RP1_jaznProvider" partnerRole="RP1_jaznRequester"/>
<partnerLink myRole="TaskManagerCallbackListener"
name="TaskManagerService" partnerRole="TaskManager"
partnerLinkType="taskmngr:TaskManager"/>
<partnerLink name="TaskRoutingService"
partnerRole="TaskRoutingService"
partnerLinkType="taskroutingservice:TaskRoutingService"/>
<partnerLink myRole="HandleTaskActionRequester"
name="TaskActionHandler" partnerRole="HandleTaskActionProvider"
partnerLinkType="taskactionhandler:TaskActionHandler"/>
<partnerLink name="IdentityService"
partnerRole="IdentityServiceProvider"
partnerLinkType="identityservice:IdentityService"/>
</partnerLinks><!--
================================================================= --><!-
- VARIABLES --
><!-- List of messages and XML documents used within this BPEL process
--><!--
================================================================= -->
<variables><!-- Reference to the message passed as input during
initiation -->
<variable name="inputVariable"
messageType="client:RP1_jaznRequestMessage"/><!-- Reference to the
message that will be sent back to the
requester during callback
135
-->
<variable name="outputVariable"
messageType="client:RP1_jaznResponseMessage"/>
<variable name="SimpleUserActivityVar1" element="task:task"/>
</variables><!--
================================================================= --><!-
- ORCHESTRATION LOGIC --
><!-- Set of activities coordinating the flow of messages across the
--><!-- services integrated within this business process
--><!--
================================================================= -->
<sequence name="main"><!-- Receive input from requestor.
Note: This maps to operation defined in RP1_jazn.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:RP1_jazn" operation="initiate" variable="inputVariable"
createInstance="yes"/><!-- Asynchronous callback to the requester.
Note: the callback location and correlation id is transparently
handled
using WS-addressing.
-->
<scope name="SimpleUserActivity1" variableAccessSerializable="no"
xmlns:taskactionhandler="http://xmlns.oracle.com/pcbpel/taskservice/task
ActionHandler" xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:taskmngr="http://xmlns.oracle.com/pcbpel/taskservice/taskmanager"
xmlns:task="http://xmlns.oracle.com/pcbpel/taskservice/task"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:wf="http://schemas.oracle.com/bpel/extension/workflow"
wf:key="SimpleUserActivityVar1;taskConfigSimpleUserActivity1.xml;SimpleU
serActivity;Task4Eric;bpws:getVariableData('outputVariable', 'payload',
'/client:RP1_jaznProcessResponse/client:result');;;;;">
<variables>
<variable name="oraBPMTaskMessage"
messageType="taskmngr:taskMessage"/>
<variable name="oraBPMTaskErroredFaultMessage"
messageType="taskmngr:taskErroredMessage"/>
<variable name="oraBPMTemporaryVariable" type="xsd:string"/>
</variables>
<correlationSets>
<correlationSet name="oraBPMTaskIdCor"
properties="taskmngr:taskId"/>
</correlationSets>
<sequence>
<assign name="setUserDefinedAttributes">
<copy>
<from expression=""Task4Eric""/>
<to variable="SimpleUserActivityVar1"
query="/task:task/task:title"/>
</copy>
<copy>
<from expression="bpws:getVariableData('outputVariable',
'payload', '/client:RP1_jaznProcessResponse/client:result')"/>
136
<to variable="SimpleUserActivityVar1"
query="/task:task/task:payload"/>
</copy>
<copy>
<from expression="string('hverbeek')"/>
<to variable="SimpleUserActivityVar1"
query="/task:task/task:assigneeUsers[1]"/>
</copy>
<copy>
<from expression="concat(ora:getProcessURL(),
string('/taskConfigSimpleUserActivity1.xml'))"/>
<to variable="SimpleUserActivityVar1"
query="/task:task/task:taskType"/>
</copy>
</assign>
<assign name="setSystemDefinedAttributes">
<copy>
<from expression="ora:getInstanceId()"/>
<to variable="SimpleUserActivityVar1"
query="/task:task/task:instanceId"/>
</copy>
<copy>
<from expression="ora:getProcessId()"/>
<to variable="SimpleUserActivityVar1"
query="/task:task/task:processName"/>
</copy>
<copy>
<from expression="ora:getProcessId()"/>
<to variable="SimpleUserActivityVar1"
query="/task:task/task:processId"/>
</copy>
<copy>
<from expression="ora:getProcessVersion()"/>
<to variable="SimpleUserActivityVar1"
query="/task:task/task:processVersion"/>
</copy>
<copy>
<from expression="ora:getDomainId()"/>
<to variable="SimpleUserActivityVar1"
query="/task:task/task:domainId"/>
</copy>
<copy>
<from expression="ora:getProcessOwnerId()"/>
<to variable="SimpleUserActivityVar1"
query="/task:task/task:processOwner"/>
</copy>
<copy>
<from expression="string('SINGLE_APPROVAL')"/>
<to variable="SimpleUserActivityVar1"
query="/task:task/task:pattern"/>
</copy>
<copy>
<from expression="false()"/>
<to variable="SimpleUserActivityVar1"
query="/task:task/task:hasSubTasks"/>
</copy>
<copy>
137
<from variable="SimpleUserActivityVar1"/>
<to variable="oraBPMTaskMessage" part="payload"/>
</copy>
</assign>
<scope name="initiateTask">
<faultHandlers>
<catch faultName="taskmngr:taskErroredFault"
faultVariable="oraBPMTaskErroredFaultMessage">
<assign name="readErroredTask">
<copy>
<from variable="oraBPMTaskErroredFaultMessage"
part="payload"/>
<to variable="oraBPMTaskMessage" part="payload"/>
</copy>
</assign>
</catch>
</faultHandlers>
<sequence>
<invoke name="initiateTask" partnerLink="TaskManagerService"
portType="taskmngr:TaskManager" operation="initiateTask"
inputVariable="oraBPMTaskMessage" outputVariable="oraBPMTaskMessage"/>
</sequence>
</scope>
<sequence>
<invoke name="initiateTaskActionHandler"
partnerLink="TaskActionHandler"
portType="taskactionhandler:TaskActionHandler" operation="initiate"
inputVariable="oraBPMTaskMessage">
<correlations>
<correlation set="oraBPMTaskIdCor" initiate="yes"
pattern="out"/>
</correlations>
</invoke>
<receive name="receiveUpdatedTask"
partnerLink="TaskActionHandler"
portType="taskactionhandler:TaskActionHandlerCallback"
operation="onTaskCompleted" variable="oraBPMTaskMessage"
createInstance="no">
<correlations>
<correlation set="oraBPMTaskIdCor" initiate="no"/>
</correlations>
</receive>
</sequence>
<assign name="readUpdatedTask">
<copy>
<from variable="oraBPMTaskMessage" part="payload"/>
<to variable="SimpleUserActivityVar1"/>
</copy>
</assign>
</sequence>
</scope>
<switch name="taskSwitch"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:tt="http://xmlns.oracle.com/pcbpel/taskservice/tasktype"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
138
<case condition="bpws:getVariableData('SimpleUserActivityVar1',
'/task:task/task:state') = 'COMPLETED' and
bpws:getVariableData('SimpleUserActivityVar1',
'/task:task/task:conclusion') = 'ACCEPT'">
<bpelx:annotation>
<bpelx:pattern>Task outcome is ACCEPT
</bpelx:pattern>
</bpelx:annotation>
<sequence>
<assign name="copyPayloadFromTask">
<copy>
<from variable="SimpleUserActivityVar1"
query="/task:task/task:payload"/>
<to variable="outputVariable" part="payload"
query="/client:RP1_jaznProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
</case>
<case condition="bpws:getVariableData('SimpleUserActivityVar1',
'/task:task/task:state') = 'COMPLETED' and
bpws:getVariableData('SimpleUserActivityVar1',
'/task:task/task:conclusion') = 'REJECT'">
<bpelx:annotation>
<bpelx:pattern>Task outcome is REJECT
</bpelx:pattern>
</bpelx:annotation>
<sequence>
<assign name="copyPayloadFromTask">
<copy>
<from variable="SimpleUserActivityVar1"
query="/task:task/task:payload"/>
<to variable="outputVariable" part="payload"
query="/client:RP1_jaznProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
</case>
<otherwise>
<bpelx:annotation>
<bpelx:pattern>Task is EXPIRED, WITHDRAWN or ERRORED
</bpelx:pattern>
</bpelx:annotation>
<sequence>
<assign name="copyPayloadFromTask">
<copy>
<from variable="SimpleUserActivityVar1"
query="/task:task/task:payload"/>
<to variable="outputVariable" part="payload"
query="/client:RP1_jaznProcessResponse/client:result"/>
</copy>
</assign>
</sequence>
</otherwise>
</switch>
139
<invoke name="callbackClient" partnerLink="client"
portType="client:RP1_jaznCallback" operation="onResult"
inputVariable="outputVariable"/>
</sequence>
</process>
Oracle BPEL PM supports this pattern directly. The organizational structure, including the
roles assigned to the users, can be specified in the jazn-data.xml and user-
properties.xml, the content of which is vizible for the designer creating a process model.
Specifying one of the existing roles as a task assignee (Figure 41) would make a work
item visible in the worklists of users with the corresponding role. Note that Oracle BPEL
PM makes no distinction between groups and roles.
Oracle BPEL PM supports this pattern directly. It allows specifying a task assignee by
means of an XPath expression which is evaluated at run-time.
RP4 (Authorization)
Description: The ability to specify the range of resources that are authorized to execute a
task.
This pattern is not supported by Oracle BPEL. It is possible to assign a work item to a
specified role, and this work item can be reassigned to any other user/role. However, it is
not possible to (re-)assign a task based on the condition, i.e. to a user having a certain
authority.
Oracle BPEL PM does not allow specifying the separation of duties in terms of
relationships between tasks, nor it allows the separation of duties based on security
mechanisms. Thus this pattern is not supported by Oracle BPEL PM.
Oracle BPEL PM supports this pattern directly. The feature of dynamic assignment using
an XPath expression allows specifying that a next task must be assigned to the resource
who executed the previous (first) task. In particular, the function
ora:getPreviousTaskApprover() can be used for this purposes.
140
Description: Where several resources are available to undertake a work item, the ability
to allocate a work item within a given workflow case to the same resource that undertook
a preceding work item.
Oracle BPEL PM supports this pattern directly. It allows defining user properties and
store them in user-propoerties.xml file, which become accessible via the function
ora:getUserProperty(). This function can be used in the condition associated with the
dynamic assignment feature.
Oracle BPEL PM does not offer the direct support for this pattern, but it allows
implementing this feature and accessing it via the properties of the dynamic assignment.
Oracle BPEL PM offers an indirect support for this pattern. The organizational structure is
stored in the xml format in the jazn-data.xml file, and it can be modified and extended.
The relationships between roles are specified via the role-hierarchy tree. The roles
defined become accessible via the look-up wizard.
Oracle BPEL PM allows specifying tasks which involving the user, but also the tasks
which are to be performed automatically. Any of the basic or structured activities offered
by Oracle BPEL PM in the BPEL palette are executed automatically. Thus this pattern is
directly supported.
Oracle BPEL PM supports this pattern by offering work item to members of a group. A
group containing one user allows this user to "acquire" the offered work item.
141
Oracle BPEL PM supports this pattern directly by specifying the name of a group as an
assignee of the task. As a result, the task will be offered to all members of a group, and
any of the members may acquire it. After the work item has been acquired, no other
users may acquire this work item any more.
Oracle BPEL PM supports this pattern directly. Assigning a user with a given identity
statically or dynamically, automatically allocates the work item to this user. This differs
from the pattern RP12 where the work item is offered to the user.
Oracle BPEL PM offers no direct support for this pattern. However, the feature of
assigning a work item dynamically can be used to support this pattern. For example, a
service can be implemented to retrieve resource on the random basis.
Oracle BPEL PM offers no direct support for this pattern. However, the feature of
assigning a work item dynamically can be used to support this pattern. For example, a
service can be implemented to retrieve resource based on the round-robin algorithm.
Oracle BPEL PM offers no direct support for this pattern. However, the feature of
assigning a work item dynamically can be used to support this pattern. For example, a
service can be implemented to retrieve resource based on the shortest queue algorithm.
Oracle BPEL PM supports this pattern directly: as soon as a work item becomes
available, it appears in the work list of the assigned resource.
142
RP20 (Late Distribution)
Description: The ability to advertise and allocate work items to resources after the work
item has been enabled.
Oracle BPEL PM does not support this pattern since by any work item requires to have
an assignee. Since the work item has to be allocated or offered to a user/role from the
moment of creation, the late distribution is not possible.
Oracle BPEL PM does not support this pattern directly. If a work item is assigned to a set
of users or a group, one of the users in the list can "acquire" the task. However, this
corresponds to the commence working on it immediately.
In Oracle BPEL PM resources are able to commence the execution of a work time
available at their own worklists at a time of their own choosing, but before the task has
expired. Therefore this pattern is supported directly.
Oracle BPEL PM supports this pattern directly. When a user is offered a work item, and
the user "acquires" it, he commences work on it immediately.
Oracle BPEL PM does not impose a default ordering of the work items in the resources
work queue, thus offering no support for this pattern.
Oracle BPEL PM supports this pattern directly. The user is able to format the work items
listed in his worklist based on the task id, priority and other parameters. In addition,
Oracle ships a JSP based sampe worklist application that can be customized to list
specific content on the worklist application.
143
Oracle BPEL PM supports this pattern directly. The user can select and act on any of the
task displayed in his work list.
RP27 (Delegation)
Description: The ability for a resource to allocate a work item previously allocated to it to
another resource.
Oracle BPEL PM supports this pattern directly by means of "reassign" action. As such, a
manager can delegate a task to reportees. Similarly, the process owner or a user with
BPMWorkflowReassign privileges can delegate a specific task to any other person in the
organization. Figure 44 - Figure 47 illustrate how a work item can be reassigned via the
work list application.
Figure 44 Reassign-1
Figure 45 Reassign-2
144
Figure 46 Reassign-3
Figure 47 Reassign-4
RP28 (Escalation)
Description: The ability of the workflow system to offer or allocate a work item to a
resource or group of resources other than those it has previously been offered or
allocated to in an attempt to expedite the completion of the work item.
Oracle BPEL PM supports this pattern directly by allowing escalation of a task to the
manager for further action. The escalation continues until a certain user, a certain level
(number of escalations to a 'manager'), or a certain title is reached. The escalation
feature works correctly if a task has been assigned to a specific user, however if a task
has been assigned to a role or a group, Oracle BPEL PM does not seem to know an
upper level where a task should be escalated to. Figure 48 shows the setting of the
escalation in the workflow wizard.
145
Figure 48 Escalation settings
RP29 (Deallocation)
Description: The ability of a resource (or group of resources) to relinquish a work item
which is allocated to it and make it available for allocation to another resource or group of
resources.
Oracle BPEL PM supports this pattern directly. If a work item has been assigned to a set
of users of a group, one of the users in the list can "acquire" the task. At anytime before
the task expires or before a user has updated the task, the user can "release" the task to
the set of users/group the task was originally assigned to. Figure 49 - Figure
51demonstrate how a work item can be released via the work list application.
Figure 49 Release-1
146
Figure 50 Release-2
Figure 51 Release-3
Any work item can be "reassigned" to a new set of users/group. If the user has updated a
task, after the reassignment the data provided by this user is visible to the new assignee,
i.e. the state data is not lost.
147
Oracle BPEL PM does not allow task rollback, thus offering no support for this pattern.
RP32 (Suspension/Resumption)
Description: The ability for a resource to suspend and resume execution of a work item.
Oracle BPEL PM supports this pattern directly. "suspend" and "resume" are available
actions in the worklist application.
RP33 (Skip)
Description: The ability for a resource to skip a work item allocated to it and mark the
work item as complete.
Oracle BPEL PM supports this pattern directly. As such any work item can be
"withdrawn" by the task creator or the administrator. However, there is also possibility to
model a user-action "skip", which marks a work item as completed and passes the flow
of control to the subsequent task. Figure 52- Figure 54 visualize the "skip" and "withdraw"
actions.
148
Figure 54 Withdraw
RP34 (Redo)
Description: The ability for a resource to redo a work item that has previously been
completed in a case.
RP35 (Pre-Do)
Description: The ability for a resource to execute a work item ahead of the time that it has
been offered or allocated to resources working on a given case.
Oracle BPEL PM offers no support for this pattern since a resource needs to "accept" or
"acquire" a work item from the worklist in order to start the execution.
Oracle BPEL PM offers no support for this pattern since a resource needs to "accept" or
"acquire" a work item from the worklist in order to start the execution.
149
Description: The ability of the workflow engine to automatically start the next work item in
a case once the previous one has completed.
Although Oracle BPEL PM offers the "continue task" pattern which allows one workflow
to be continued with another workflow, the transition between the workflows is not
automatic and requires a work item to be selected from the worklist. Therefore, Oracle
BPEL PM offers no support for this pattern.
Oracle BPEL PM offers no support for this pattern, since any user can see all unallocated
work items and there is no option to limit the visibility of unallocated items.
Oracle BPEL PM offers no support for this pattern, since any user can see all allocated
work items and there is no option to limit the visibility of allocated items.
Oracle BPEL PM supports this pattern partially by allowing a resource to work with
multiple browsers related to a single worklist, and thus enabling and executing several
work items simultaneously.
Oracle BPEL PM supports this pattern directly. It offers an "adhoc" pattern which allows
assigning the task to any other user run-time and "request for more information" from
other users and have them submit information for tasks. Figure 55 - Figure 59 visualize
the rerouting of a task and the request for more information.
150
Figure 55 Reroute
Figure 56 Reroute -2
Figure 57 Reroute-3
151
Figure 58 Request for more information 1
152
Conclusions
The evaluation of Oracle BPEL PM from the control-flow, data and resource perspectives
is summarized in Table 1, Table 2 and Table 3 respectively. The evaluation shows that
Oracle BPEL PM supports the majority of control patterns, data patterns and resource
patterns.
153
Table 2 Support for Data Patterns in Oracle BPEL PM
Nr Pattern name Support: Remarks
direct (+);
partial (+/-);
no support (-)
Data visibility
DP1 Task Data +/- A task must be wrapped
into a scope
DP2 Block Data - Not supported
DP3 Scope Data + Directly supported by
<scope>
DP4 Multiple Instance Data +/- Partial support dependents
on the type of the MI task
DP5 Case Data + Bound to outermost scope
in the process definition
DP6 Folder Data - Not supported
DP7 Workflow Data + Supported via deployment
descriptor properties
DP8 Environment Data + Synchronous message
interaction <invoke>,
<receive>
Internal data interaction
DP9 Data interaction – Task to Task + No data passing; data
elements shared between
tasks via access to globally
shared data
DP10 Data interaction – Block Task to Sub- - Not supported
Workflow Decomposition
DP11 Data interaction – Data interaction to - Not supported
Multiple Instance Task
DP12 Data interaction – to Multiple Instance +/- Not supported by all
Task variants of MI tasks
DP13 Data interaction – from Multiple +/- For non-directly supported
Instance Task MI task, a certain number
of instances should
complete before the data is
passed to the next task
DP14 Data Interaction – Case to Case - Not supported
External data passing
DP15 Data interaction – Task to Environment + Directly supported by
– Push-oriented means inputVariable of
<invoke>
DP16 Data interaction- Environment to Task + Direct support via <invoke>
– Pull –Oriented and <receive>
DP17 Data interaction – Environment to Task + Direct support via
– Push-Oriented <receive> and event
handlers
DP18 Data interaction – Task to Environment + Directly supported through
– Pull-oriented <receive> and <reply>
DP19 Data interaction – Case to environment - Not supported
– Push-oriented
DP20 Data interaction – Environment to - Not supported
Case – Pull-oriented
154
DP21 Data interaction – Environment to - Not supported
Case- Push-oriented
DP22 Data interaction – Case to - Not supported
Environment – Pull-oriented
DP23 Data interaction- Workflow to - Not supported
Environment – Push-oriented
DP24 Data interaction- Environment to - Not supported
Workflow – Pull-oriented
DP25 Data interaction – Environment to - Not supported
Workflow – Push-Oriented
DP26 Data interaction – Workflow to - Not supported
Environment – Pull-oriented
Data transfers mechanisms
DP27 Data passing by Value - Incoming + Directly supported by the
attributes of <assign>
wizard
DP28 Data passing by Value- Outgoing + Directly supported by the
attributes of <assign>
wizard
DP29 Data passing – Copy In/Copy Out + Directly supported by
means of two <assign>
constructs
DP30 Data passing by Reference - Unlocked + No concurrency restrictions
for accessing global data
DP31 Data passing by Reference- Locked - The serializable scope
feature does not work
according to its semantics
DP32 Data transformation - Input - Directly supported by the
attributes of <assign>
wizard
DP33 Data transformation - Output - Directly supported by the
attributes of <assign>
wizard
Data-based routing
DP34 Task precondition – Data existence - Not supported
DP35 Task Precondition – Data value + Directly supported via
joinCondition evaluation
the status of links
DP36 Task Postcondition – Data existence - Not supported
DP37 Task Postcondition – Data value - Not supported
DP38 Event-based Task Trigger + Directly supported via
<receive> and event
handlers
DP39 Data-based Task Trigger - Not supported
DP40 Data-based Routing + Directly supported via links
and <switch>
155
Table 3 Support of Resource Patterns in Oracle BPEL PM
Nr Pattern name Support (+:direct; +/-:
partial; -: no support)
RP1 Direct allocation +
RP2 Role-based Allocation +
RP3 Deferred Allocation +
RP4 Authorization -
RP5 Separation of Duties -
RP6 Case Handling +
RP7 Retain Familiar +
RP8 Capability-based Allocation +
RP9 History-based Allocation +/-
RP10 Organizational Allocation +/-
RP11 Automatic Execution +
RP12 Distribution by Offer- Single Resource +
RP13 Distribution by Offer- Multiple Resource +
RP14 Distribution by Allocation- Single Resource +
RP15 Random Allocation +/-
RP16 Round Robin Allocation +/-
RP17 Shortest Queue +/-
RP18 Early Distribution -
RP19 Distribution by Enablement +
RP20 Late Distribution -
RP21 Resource-Initiated Allocation -
RP22 Resource-Initiated Execution – Allocated Work Item +
RP23 Resource-Initiated Execution – Offered Work Item +
RP24 System-Determined Work List Management -
RP25 Resource-Determined Work List Management +
RP26 Selection Autonomy +
RP27 Delegation +
RP28 Escalation +
RP29 Deallocation +
RP30 Stateful Reallocation +
RP31 Stateless Reallocation -
RP32 Suspension/ Resumption +
RP33 Skip +
RP34 Redo -
RP35 Pre-do -
RP36 Commencement on Creation -
RP37 Commencement on Allocation -
RP38 Piled Execution -
RP39 Chained Execution -
RP40 Configurable Unallocated Work Item Visibility -
RP41 Configurable Allocated Work Item Visibility -
RP42 Simultaneous Execution +
RP43 Additional Resources +
156
Standardness and Completeness of Oracle BPEL PM
In addition to the availability of BPEL implementation, Oracle offers a set of additional
tool-specific features that allow more patterns to be supported than the original
BPEL4WS specification does. Among them the <flowN> construct allowing the creation
of multiple instances of a task at the run-time. Unfortunately, the semantics of this
construct is not clear. From the data perspective, Oracle allows performing basic
transformation on data and supporting data patterns 31 and 32. Originally, these patterns
are not supported by BPEL [1].
There are some inconsistencies in the implementation which were revealed during the
evaluation of Oracle BPEL PM:
- The specification of the seriazable scopes (variableAccessSerializable="yes")
does not ensure the exclusive access to the shared data.
157
Related work
In [11] Martin Vasko and Schahram Dustdar offer the results of evaluation of web
services workflow patterns in Collaxa. The majority of their results coincide with the ones
reported in this document. However, several remarks can be made:
- The authors claim the direct support for the workflow pattern MI with
synchronization (all three variants, i.e. with a-priori design-time knowledge, a-
priori run-time knowledge, and no a-priori run-time knowledge), while offering the
solution only for the MI with synchronization with a-priori design-time knowledge.
- The canceling patterns (Cancel Activity and Cancel Case) are claimed to be
directly supported, while only the solution for the case cancellation is provided.
In [1] Petia Wohed, Wil van der Aalst, Marlon Dumas, and Artur ter Hofstede offer the
results of the evaluation of the BPEL4WS based on the workflow control and
communication patterns. Relating to the evaluation from the control-flow perspective, the
majority of the results of their evaluation coincide with the results reported in this
document. However, several remarks can be made:
- In [1] the pattern MI with a-priori run-time knowledge is not supported by BPEL,
while Oracle BPEL PM supports it directly by the Oracle specific <flowN>
construct;
- In [1] the pattern Interleaved Parallel Routing is partially supported, while the
suggested solution implemented in Oracle BPEL PM does not seem to work.
In contrast to the evaluations documented in [1] and [11], which focused only on the
control-flow perspective, the scope of this work has been extended also by the data and
resource perspectives. The work reported in this document is part of the Workflow
Pattern Initiative (cf. www.workflowpatterns.com). In the context of this initiative the
workflow control, data and resource patterns have been developed that concentrate on
the different perspectives of Process-Aware Information Systems [14].
158
Acknowledgements
The evaluation of Oracle BPEL PM has been performed with involvement of several
parties. I would like to thank Eric Verbeek for the direct involvement in the evaluation; Wil
van der Aalst, Marlon Dumas, Nick Russels, and Schahram Dustdar for the constructive
feedbacks they provided. Finally, I would like to thank Oracle-representatives David
Shaffer, Ravi Rangaswami and Bhagat Nainani for the provided information, their support
and collaboration in the evaluation of Oracle BPEL PM.
159
References
[1] P. Wohed, W.M.P. van der Aalst, M. Dumas, and A.H.M. ter Hofstede. Pattern-Based
Analysis of BPEL4WS. QUT Technical report, FIT-TR-2002-04, Queensland
University of Technology, Brisbane, 2002.
[3] P. Wohed, W.M.P. van der Aalst, M. Dumas, and A.H.M. ter Hofstede.
Analysis of Web Services Composition Languages: The Case of BPEL4WS.
In I.Y. Song, S.W. Liddle, T.W. Ling, and P. Scheuermann, editors, 22nd International
Conference on Conceptual Modeling (ER 2003), volume 2813 of Lecture Notes in
Computer Science, pages 200-215. Springer-Verlag, Berlin, 2003.
[4] W.M.P. van der Aalst, M. Dumas, and A.H.M. ter Hofstede.
Web Service Composition Languages: Old Wine in New Bottles?
In G. Chroust and C. Hofer, editors, Proceeding of the 29th EUROMICRO
Conference: New Waves in System Architecture, pages 298-305. IEEE Computer
Society, Los Alamitos, CA, 2003.
[5] J. Mendling, M. zur Muehlen, A. Price: Standards for Workflow Definition and
Execution. In: M. Dumas, A. ter Hofstede, W.M.P. van der Aalst: Process Aware
Information Systems, Wiley Publishing, to appear 2005.
[8] W.M.P. van der Aalst, A.H.M. ter Hofstede, B. Kiepuszewski, and A.P. Barros.
Workflow Patterns. Distributed and Parallel Databases, 14(1):5-51, 2003.
[9] N. Russell, A.H.M. ter Hofstede, D. Edmond, and W.M.P. van der Aalst. Workflow
Data Patterns. Queensland University of Technology, Brisbane, December, 2004.
http://www.bpm.fit.qut.edu.au/projects/babel/docs/DataPatternsRevised.pdf
[10] N. Russell, A.H.M. ter Hofstede, D. Edmond, W.M.P. van der Aalst. Workflow
Resource Patterns, 2004, BETA Working Paper Series, WP 127, Eindhoven
University of Technology, Eindhoven.
160
[11] Vasko, M., Dustdar, S. An Analysis of Web services Workflow Patterns in Collaxa.
European Conference on Web services (ECOWS) 2004, 27 - 30 September 2004,
Erfurt, Germany, Springer LNCS.
[12] Oracle BPEL Process Manager provides SOA and Integration Support. Cover
pages hosted by OASIS. http://xml.coverpages.org/ni2004-06-30-a.html
[13] Oracle BPEL Process Manager (10.1.2) developers guide, appeared in June 29,
2005 http://download-uk.oracle.com/otndocs/products/bpel/bpeldev.pdf
[14] M. Dumas, W.M.P. van der Aalst, A.H.M. ter Hofstede. Process-Aware Information
Systems, 2005, Wiley.
[15] R. Shapiro. A comparison of XPDL, BPML and BPEL4WS (Version 1.4), 2002,
http://xml.coverpages.org/Shapiro-XPDL.pdf
161