DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

  1. DZone
  2. Refcards
  3. Core WS-BPEL: Business Process Execution Language
refcard cover
Refcard #077

Core WS-BPEL: Business Process Execution Language

Business Process Execution Language

Covers WS-BPEL 2.0, its process structure, standard faults, default attribute values, and all important BPEL activities.

Download Refcard
Free PDF for Easy Reference
refcard cover

Written By

author avatar Matjaz Juric
Professor, University of Maribor
Table of Contents
► Overview ► Overall Structure of a BPEL Process ► Partner Links ► Variables ► Process Flow Activities ► "Standard-Elements" ► "Standard-Attributes" ► BPEL Activities ► Conditional Behavior ► Loops ► Scopes ► Fault Handling ► Event Handlers ► Compensation ► Termination Handler ► Message Exchanges ► XSLT Transformation ► Properties ► Correlation
Section 1

Overview

By Matjaz B. Juric

Each BPEL process consists of the following: (a) BPEL code, which defines the orchestration flow; (b) WSDL interface, which defines the interface (and the related XML Schemas) of the BPEL process for its clients; (c) WSDL interfaces of the consumed services (partner links). Partner links define the relations between BPEL process and the web services. Figure 1 shows the overall structure of a BPEL process.

overall structure of a BPEL process

Section 2

Overall Structure of a BPEL Process

​x
1
​
2
<process name="NCName" targetNamespace="anyURI"
3
queryLanguage="anyURI"?
4
expressionLanguage="anyURI"?
5
suppressJoinFailure="yes|no"?
6
exitOnStandardFault="yes|no"?
7
xmlns="http://docs.oasisopen.org/wsbpel/2.0/process/executable">
8
<extensions/>?
9
<import/>*
10
<partnerLinks/>?
11
<messageExchanges/>?
12
<variables/>
13
<correlationSets/>?
14
<faultHandlers/>?
15
<eventHandlers/>?
16
activity
17
</process>
18
​
activity Two different types of processes:
  • Use <sequence> for sequential execution of process activities.
  • Use <flow> together with <links> for concurrent execution of process activities.
Section 3

Partner Links

<plnk:partnerLinkType>

Characterizes a relationship between two services. We define roles played by each of the services. We specify the used portType of each service within the context of the conversation. Each <role> specifies exactly one WSDL portType. <plnk:partnerLinkType> is defined in the service WSDL document, not in the BPEL.

10
1
​
2
<wsdl:definitions name="NCName" targetNamespace="anyURI" ...>
3
...
4
<plnk:partnerLinkType name="NCName">
5
<plnk:role name="NCName" portType="QName" />
6
<plnk:role name="NCName" portType="QName" />?
7
</plnk:partnerLinkType>
8
...
9
</wsdl:definitions>
10
​

Example:

6
1
​
2
<plnk:partnerLinkType name="OrderLT">
3
<plnk:role name="OrderService" portType="ord:OrderPT" />
4
<plnk:role name="OrderRequester" portType="ord:OrderCallbackPT" />
5
</plnk:partnerLinkType>
6
​

<partnerLink>

Defines the relation of the BPEL process to partner web services. For request-reply semantics specify both roles, for one-way semantics specify one role only.

11
1
​
2
<partnerLinks>?
3
<!-- At least one role must be specified. -->
4
<partnerLink name="NCName"
5
partnerLinkType="QName"
6
myRole="NCName"?
7
partnerRole="NCName"?
8
initializePartnerRole="yes|no"?>+
9
</partnerLink>
10
</partnerLinks>
11
​

Example:

7
1
​
2
<partnerLinks>
3
<partnerLink name="Ordering"
4
partnerLinkType="tns:OrderLT"
5
myRole="OrderRequester" partnerRole="OrderService" />
6
</partnerLinks>
7
​

<sref:service-ref>

Endpoint references associated with partnerRole and myRole of <partnerLink>s are manifested as service reference containers (<sref:service-ref>).

5
1
​
2
<sref:service-ref reference-scheme="URI">
3
content
4
</sref:service-ref>
5
​

Default is WS-Addressing endpoint reference:

12
1
​
2
<sref:service-ref>
3
<addr:EndpointReference>
4
<addr:Address>
5
http://example.com/auction/Registration/
6
</addr:Address>
7
<addr:ServiceName>
8
as:RegistrationService
9
</addr:ServiceName>
10
</addr:EndpointReference>
11
</sref:service-ref>
12
​
Section 4

Variables

Variable Declaration

<variables>

Declare variables within a process or a scope. Variables hold XML data. Variable can be one of the following types: WSDL message type, XML Schema type, or XML Schema element. Variable is visible in the scope in which it is defined and in all nested scopes.

Syntax:

10
1
​
2
<variables>
3
<variable name="BPELVariableName"
4
messageType="QName"?
5
type="QName"?
6
element="QName"?>+
7
from-spec?
8
</variable>
9
</variables>
10
​

Example:

6
1
​
2
<variables>
3
<variable name="OrderForm"
4
messageType="ord:OrderFormMsg" />
5
</variables>
6
​

Manipulating Variables

<assign>

Update and copy data between variables, expressions, and partner link endpoint references.

10
1
​
2
<assign validate="yes|no"? standard-attributes>
3
standard-elements
4
<copy keepSrcElementName="yes|no"?
5
ignoreMissingFromData="yes|no"?>
6
from-spec
7
to-spec
8
</copy>
9
</assign>
10
​
from-spec
17
1
​
2
<from variable="BPELVariableName" part="NCName"?>
3
<query queryLanguage="anyURI"?>?
4
queryContent
5
</query>
6
</from>
7
<from partnerLink="NCName"
8
endpointReference="myRole|partnerRole" />
9
<from variable="BPELVariableName"
10
property="QName" />
11
<from expressionLanguage="anyURI"?>
12
expression
13
</from>
14
<from>
15
<literal>literal value
16
</from>
17
<from/>


to-spec
13
1
​
2
<to variable="BPELVariableName" part="NCName"?>
3
<query queryLanguage="anyURI"?>?
4
queryContent
5
</query>
6
</to>
7
<to partnerLink="NCName" />
8
<to variable="BPELVariableName"
9
property="QName" />
10
<to expressionLanguage="anyURI"?>
11
expression
12
</to>
13
<to/>


messageType $VariableName.part/ns:node1/ns:node2/...
Type $VariableName/ns:node1/ns:node2/...
Element $VariableName/ns:node1/ns:node2/...

Example:

8
1
​
2
<assign>
3
<copy>
4
<from>$Order/Item/Amount * $ExchangeRate
5
<to>$OrderFrgn/Item/Amount
6
</copy>
7
</assign>
8
​

<validate>

Validates the values of variable against the associated XML or WSDL data definition. For invalid validation, bpel:invalidVariables fault is thrown.

5
1
​
2
<validate variables="BPELVariableNames" standard-attributes>
3
standard-elements
4
</validate>
5
​

Example:

3
1
​
2
<validate variables="Order OrderFrgn"/>
3
​
Section 5

Process Flow Activities

<sequence>

Defines a set of activities that will be executed in sequential order.

6
1
​
2
<sequence standard-attributes>
3
standard-elements
4
activity+
5
</sequence>
6
​

Example:

8
1
​
2
<sequence name="OrderProcessing">
3
<receive .../>
4
<assign>...</assign>
5
<invoke .../>
6
<reply .../>
7
</sequence>
8
​

<flow>

Specifies activities that should be performed concurrently.

9
1
​
2
<flow standard-attributes>
3
standard-elements
4
<links>?
5
<link name="NCName" />+
6
</links>
7
activity+
8
</flow>
9
​

Example:

7
1
​
2
<flow name="CheckPrice">
3
<invoke name="CheckSupl1" .../>
4
<invoke name="CheckSupl2" .../>
5
<invoke name="CheckSupl3" .../>
6
</flow>
7
​

To define synchronization dependencies between activities within <flow>, we use <links>. This way we define the order of execution. Links have to be declared within the <flow>.

Section 6

"Standard-Elements"

Links: <targets> and <sources>

Define source and destination links for synchronization of flow activities. <source> is used to annotate an activity being a source of one or more links. <target> is used to annotate an activity being a target of one or more links. A link's target activity can be performed only after the source activity has been finished.

16
1
​
2
<targets>?
3
<joinCondition expressionLanguage="anyURI"?>?
4
bool-expr
5
</joinCondition>
6
<target linkName="NCName" />+
7
</targets>
8
​
9
<sources>?
10
<source linkName="NCName">+
11
<transitionCondition expressionLanguage="anyURI"?>?
12
bool-expr
13
</transitionCondition>
14
</source>
15
</sources>
16
​

Example:

25
1
​
2
<flow>
3
<links>
4
<link name="TravelStatusToTicketRequest" />
5
<link name="TicketRequestToTicketConfirmation" />
6
</links>
7
<assign>
8
<sources>
9
<source linkName="TravelStatusToTicketRequest" />
10
</sources>
11
<copy>...</copy>
12
</assign>
13
<invoke partnerLink="TicketConf" portType="tc:TicketPT"
14
operation="ConfirmTicket" inputVariable="TicketRequestVar"
15
outputVariable="TicektConfVar" >
16
<targets>
17
<target linkName="TravelStatusToTicketRequest" />
18
</targets>
19
<sources>
20
<source linkName="TicketRequestToTicketConfirmation" />
21
</sources>
22
</invoke>
23
...
24
</flow>
25
​

<joinCondition>

Defines explicit join condition for incoming (<target>) links. Default is OR (at least one incoming link to be true). Positive join condition (true) is required for starting the activity. If join condition evaluates to false, bpel:joinFailure fault is thrown (except if suppressJoinFailure="yes"). Example:

7
1
​
2
<targets>
3
<joinCondition>$TicketApproved and $DiscountGiven</joinCondition>
4
<target linkName="OrderTicket" />
5
<target linkName="IssuePayment" />
6
</targets>
7
​

<transitionCondition>

Defines the condition for outgoing (<source>) links to have positive status. Default is that they evaluate to true. Example:

14
1
​
2
<sources>
3
<source linkName="IssuePaymentAutomatic">
4
<transitionCondition>
5
$Ticket.Amount < 1000
6
</transitionCondition>
7
</source>
8
<source linkName=" IssuePaymentWithApproval">
9
<transitionCondition>
10
$Ticket.Amount >= 1000
11
</transitionCondition>
12
</source>
13
</sources>
14
​
Section 7

"Standard-Attributes"

suppressJoinFailure

Indicates whether a bpel:joinFailure fault should be suppressed or not. When not specified, it inherits its value from its closest enclosing construct.

3
1
​
2
suppressJoinFailure="yes|no"?
3
​

name

To give a name to the BPEL activity (not related with links).

3
1
​
2
name="NCName"?
3
​
Section 8

BPEL Activities

<invoke>

Invokes an operation on a partner link web service.

32
1
​
2
<invoke partnerLink="NCName"
3
portType="QName"?
4
operation="NCName"
5
inputVariable="BPELVariableName"?
6
outputVariable="BPELVariableName"?
7
standard-attributes>
8
standard-elements
9
<correlations>?
10
<correlation set="NCName" initiate="yes|join|no"?
11
pattern="request|response|request-response"? />+
12
</correlations>
13
<catch faultName="QName"?
14
faultVariable="BPELVariableName"?
15
faultMessageType="QName"?
16
faultElement="QName"?>*
17
activity
18
</catch>
19
<catchAll>?
20
activity
21
</catchAll>
22
<compensationHandler>?
23
activity
24
</compensationHandler>
25
<toParts>?
26
<toPart part="NCName" fromVariable="BPELVariableName" />+
27
</toParts>
28
<fromParts>?
29
<fromPart part="NCName" toVariable="BPELVariableName" />+
30
</fromParts>
31
</invoke>
32
​

Example:

7
1
​
2
<invoke partnerLink="Ordering"
3
portType="ord:OrderPT"
4
operation="ConfirmOrder"
5
inputVariable="Order"
6
outputVariable="OrderConf" />
7
​

<receive>

Waits for an incoming message (operation invocation). Typical uses: first process activity (createInstance="yes"); to wait for callbacks.

17
1
​
2
<receive partnerLink="NCName"
3
portType="QName"?
4
operation="NCName"
5
variable="BPELVariableName"?
6
createInstance="yes|no"?
7
messageExchange="NCName"?
8
standard-attributes>
9
standard-elements
10
<correlations>?
11
<correlation set="NCName" initiate="yes|join|no"? />+
12
</correlations>
13
<fromParts>?
14
<fromPart part="NCName" toVariable="BPELVariableName" />+
15
</fromParts>
16
</receive>
17
​

Example:

6
1
​
2
<receive partnerLink="Ordering"
3
portType="ord:OrderCallbackPT"
4
operation="confirmOrder"
5
variable="OrderConfirmation"/>
6
​

<pick>

Waits for one of several possible messages (operation invocations) or for a time-out.

27
1
​
2
<pick> can be the first process activity (createInstance="yes", no <onAlarm> allowed).
3
<pick createInstance="yes|no"? standard-attributes>
4
standard-elements
5
<onMessage partnerLink="NCName"
6
portType="QName"?
7
operation="NCName"
8
variable="BPELVariableName"?
9
messageExchange="NCName"?>+
10
<correlations>?
11
<correlation set="NCName" initiate="yes|join|no"? />+
12
</correlations>
13
<fromParts>?
14
<fromPart part="NCName" toVariable="BPELVariableName" />+
15
</fromParts>
16
activity
17
</onMessage>
18
<onAlarm>*
19
(
20
<for expressionLanguage="anyURI"?>duration-expr</for>
21
|
22
<until expressionLanguage="anyURI"?>deadline-expr</until>
23
)
24
activity
25
</onAlarm>
26
</pick>
27
​

Example:

20
1
​
2
<pick>
3
<onMessage partnerLink="Ordering"
4
portType="ord:OrderPT"
5
operation="confirmOrder"
6
variable="OrderConfirmation">
7
...
8
</onMessage>
9
<onMessage partnerLink="Ordering"
10
portType="ord:OrderPT"
11
operation="cancelOrder"
12
variable="OrderCancelation">
13
...
14
</onMessage>
15
<onAlarm>
16
<for>'PT12H'</for>
17
<!-- Order completion timed out -->
18
</onAlarm>
19
</pick>
20
​

<reply>

Sends a response for a request-response operation (synchronous). The request is received using either <receive>, <onMessage>, or <onEvent>.

17
1
​
2
<reply partnerLink="NCName"
3
portType="QName"?
4
operation="NCName"
5
variable="BPELVariableName"?
6
faultName="QName"?
7
messageExchange="NCName"?
8
standard-attributes>
9
standard-elements
10
<correlations>?
11
<correlation set="NCName" initiate="yes|join|no"? />+
12
</correlations>
13
<toParts>?
14
<toPart part="NCName" fromVariable="BPELVariableName" />+
15
</toParts>
16
</reply>
17
​

Example:

6
1
​
2
<reply partnerLink="Ordering"
3
portType="ord:OrderPT"
4
operation="placeOrder"
5
variable="Order"/>
6
​

<wait>

Waits for a specified time period or until a certain deadline.

10
1
​
2
<wait standard-attributes>
3
standard-elements
4
(
5
<for expressionLanguage="anyURI"?>duration-expr</for>
6
|
7
<until expressionLanguage="anyURI"?>deadline-expr</until>
8
)
9
</wait>
10
​

Example:

5
1
​
2
<wait>
3
<until>'2010-03-18T20:00+01:00'</until>
4
</wait>
5
​

<exit>

Immediately ends the BPEL process instance.

5
1
​
2
<exit standard-attributes>
3
standard-elements
4
</exit>
5
​

Example:

3
1
​
2
<exit/>
3
​

<empty>

This activity does not do anything. It is useful for synchronization of concurrent activities.

5
1
​
2
<empty standard-attributes>
3
standard-elements
4
</empty>
5
​

Example:

3
1
​
2
<empty/>
3
​

deadline-expr

Used in until expression of <onAlarm> and <wait>. XML Schema date or dateTime types are used to express deadlines (following ISO 8601).

5
1
​
2
<until>'2010-01-01'</until>
3
<until>'2010-03-18T21:00:00+01:00'</until>
4
<until>'18:05:30Z'</until>
5
​

duration-expr

Used in for expression of <onAlarm> and <wait>, and <repeatEvery> expression of <onAlarm>. XML Schema duration type is used (following ISO 8601).

5
1
​
2
<for>'PT4H10M'</for>
3
<for>'P1M3DT4H10M'</for>
4
<for>'P1Y11M14DT4H10M30S'</for>
5
​
P Time duration designator. Duration expressions always start with P.
Y Follows the number of years.
M Follows the number of months or minutes.
D Follows the number of days.
H Follows the number of hours.
S Follows the number of seconds.
T Date-Time separator
Section 9

Conditional Behavior

<if>

To model decisions. <if> selects exactly one activity from the set of choices.

16
1
​
2
<if standard-attributes>
3
standard-elements
4
<condition expressionLanguage="anyURI"?>bool-expr</condition>
5
activity
6
<elseif>*
7
<condition expressionLanguage="anyURI"?>
8
bool-expr
9
</condition>
10
activity
11
</elseif>
12
<else>?
13
activity
14
</else>
15
</if>
16
​

Example:

17
1
​
2
<if>
3
<condition>
4
$Order.Amount > 1000
5
</condition>
6
... <!-- Make approval -->
7
<elseif>
8
<condition>
9
$Order.Amount >= 0
10
</condition>
11
... <!-- Process automatically -->
12
</elseif>
13
<else>
14
... <!-- Throw fault -->
15
</else>
16
</if>
17
​
Section 10

Loops

<while>

Define a loop that repeats as long as the specified <condition> is true.

7
1
​
2
<while standard-attributes>
3
standard-elements
4
<condition expressionLanguage="anyURI"?>bool-expr</condition>
5
activity
6
</while>
7
​

Example:

6
1
​
2
<while>
3
<condition>$Order.Amount < 1000</condition>
4
<sequence>...</sequence>
5
</while>
6
​

<repeatUntil>

Defines a loop that repeats until the specified <condition> becomes true. The <condition> is tested after the loop activities complete. Loop will execute at least once.

7
1
​
2
<repeatUntil standard-attributes>
3
standard-elements
4
activity
5
<condition expressionLanguage="anyURI"?>bool-expr</condition>
6
</repeatUntil>
7
​

Example:

6
1
​
2
<repeatUntil>
3
<sequence>...</sequence>
4
<condition>$Order.Amount >= 1000</condition>
5
</repeatUntil>
6
​

<forEach>

Iterates its child scope activities in parallel (parallel="yes") or sequential manner, exactly <finalCounterValue>-<startCounterValue>+1 times. An optional <completionCondition> allows the <forEach> activity to complete without executing or finishing all the branches specified.

19
1
​
2
<forEach counterName="BPELVariableName" parallel="yes|no"
3
standard-attributes>
4
standard-elements
5
<startCounterValue expressionLanguage="anyURI"?>
6
unsigned-integer-expression
7
</startCounterValue>
8
<finalCounterValue expressionLanguage="anyURI"?>
9
unsigned-integer-expression
10
</finalCounterValue>
11
<completionCondition>?
12
<branches expressionLanguage="anyURI"?
13
successfulBranchesOnly="yes|no"?>
14
unsigned-integer-expression
15
</branches>
16
</completionCondition>
17
<scope ...>...</scope>
18
</forEach>
19
​

Example:

9
1
​
2
<forEach counterName="NoOfSuppliers" parallel="yes">
3
<startCounterValue>1</startCounterValue>
4
<finalCounterValue>3</finalCounterValue>
5
<scope>
6
<invoke name="CheckPrice" .../>
7
</scope>
8
</forEach>
9
​
Section 11

Scopes

<scope>

Defines a nested process scope with its own associated <partnerLinks>, <messageExchanges>, <variables>, <correlationSets>, <faultHandlers>, <compensationHandler>, <terminationHandler>, and <eventHandlers>.

15
1
​
2
<scope isolated="yes|no"? exitOnStandardFault="yes|no"?
3
standard-attributes>
4
standard-elements
5
<partnerLinks/>?
6
<messageExchanges/>?
7
<variables/>?
8
<correlationSets/>?
9
<faultHandlers/>?
10
<compensationHandler/>?
11
<terminationHandler/>?
12
<eventHandlers/>?
13
activity
14
</scope>
15
​

Example:

10
1
​
2
<scope name="CheckSupplier">
3
<partnerLinks>...</partnerLinks>
4
<variables>...</variables>
5
<faultHandlers>...</faultHandlers>
6
<sequence>
7
...
8
</sequence>
9
</scope>
10
​
Section 12

Fault Handling

<throw>

Generates a fault from inside the business process. Fault is identified by a qualified name.

7
1
​
2
<throw faultName="QName"
3
faultVariable="BPELVariableName"?
4
standard-attributes>
5
standard-elements
6
</throw>
7
​

Example:

3
1
​
2
<throw faultName="tns:InvalidOrder" />
3
​

<rethrow>

Rethrows the fault that was originally caught by the enclosing fault handler. <rethrow> can only be used within a fault handler (<catch> or <catchAll>).

5
1
​
2
<rethrow standard-attributes>
3
standard-elements
4
</rethrow>
5
​

Example:

3
1
​
2
<rethrow />
3
​

<faultHandlers>

Define the activities that are performed in response to faults. Fault handler can be <catch> or <catchAll>. They can be defined at the <process> level, within <scope>s, or inline for <invoke>.

13
1
​
2
<faultHandlers>?
3
<!-- There must be at least one faultHandler -->
4
<catch faultName="QName"?
5
faultVariable="BPELVariableName"?
6
( faultMessageType="QName" | faultElement="QName" )? >*
7
activity
8
</catch>
9
<catchAll>?
10
activity
11
</catchAll>
12
</faultHandlers>
13
​

Default fault handler:

10
1
​
2
<faultHandlers>
3
<catchAll>
4
<sequence>
5
<compensate />
6
<rethrow />
7
</sequence>
8
</catchAll>
9
</faultHandlers>
10
​
Section 13

Event Handlers

<eventHandlers>

Allow a process or scope to react on inbound messages (operation invocations) or on alarms. Event handler must contain at least one <onEvent> or <onAlarm> element. It can be defined at the <process> level or within <scope>s.

31
1
​
2
<eventHandlers>?
3
<!-- There must be at least one onEvent or onAlarm. -->
4
<onEvent partnerLink="NCName"
5
portType="QName"?
6
operation="NCName"
7
( messageType="QName" | element="QName" )?
8
variable="BPELVariableName"?
9
messageExchange="NCName"?>*
10
<correlations>?
11
<correlation set="NCName" initiate="yes|join|no"? />+
12
</correlations>
13
<fromParts>?
14
<fromPart part="NCName" toVariable="BPELVariableName" />+
15
</fromParts>
16
<scope ...>...</scope>
17
</onEvent>
18
<onAlarm>*
19
<!-- There must be at least one expression. -->
20
(
21
<for expressionLanguage="anyURI"?>duration-expr</for>
22
|
23
<until expressionLanguage="anyURI"?>deadline-expr</until>
24
)?
25
<repeatEvery expressionLanguage="anyURI"?>
26
duration-expr
27
</repeatEvery>?
28
<scope ...>...</scope>
29
</onAlarm>
30
</eventHandlers>
31
​

Example:

19
1
​
2
<eventHandlers>
3
<onEvent partnerLink="Ordering"
4
portType="ord:OrderPT"
5
operation="CancelOrder"
6
messageType="ord:CancelOrderMsg"
7
variable="CancelationDetails">
8
<scope>
9
...
10
</scope>
11
</onEvent>
12
<onAlarm>
13
<for>'PT12H'</for>
14
<scope>
15
...
16
</scope>
17
</onAlarm>
18
</eventHandlers>
19
​
Section 14

Compensation

<compensationHandler>

Defines activities that are processed for compensation. Can be defined within <scope> or inline for <invoke>.

5
1
​
2
<compensationHandler>
3
activity
4
</compensationHandler>
5
​

Default compensation handler:

5
1
​
2
<compensationHandler>
3
<compensate />
4
</compensationHandler>
5
​

<compensateScope>

Starts compensation on a specified inner scope that has already completed successfully. <compensateScope> can only be used within a fault handler, another compensation handler, or a termination handler.

5
1
​
2
<compensateScope target="NCName" standard-attributes>
3
standard-elements
4
</compensateScope>
5
​

Example:

3
1
​
2
<compensateScope target="PlaceOrder" />
3
​

<compensate>

Starts compensation on all inner scopes that have already completed successfully, in default order. <compensate> can only be used within a fault handler, another compensation handler, or a termination handler.

5
1
​
2
<compensate standard-attributes>
3
standard-elements
4
</compensate>
5
​

Example:

3
1
​
2
<compensate />
3
​
Section 15

Termination Handler

<terminationHandler>

Defines the activities that are performed when a BPEL process is force terminated. Can be defined within <scope>.

5
1
​
2
<terminationHandler>
3
activity
4
</terminationHandler>
5
​

Default compensation handler:

5
1
​
2
<terminationHandler>
3
<compensate />
4
</terminationHandler>
5
​
Section 16

Message Exchanges

<messageExchanges>

Used to name message exchanges.

5
1
​
2
<messageExchanges>?
3
<messageExchange name="NCName" />+
4
</messageExchanges>
5
​

Default compensation handler:

5
1
​
2
<messageExchanges>
3
<messageExchange name="OrderME" />
4
</messageExchanges>
5
​

messageExchange attribute

Used to associate inbound message activities with <reply> activities (for example <receive> with <reply>). Use only if the execution can result in multiple pairs of inbound message activities and <reply>s.

Section 17

XSLT Transformation

7
1
​
2
object bpel:doXslTransform(string1, node-set, (string2, object)*)
3
string1 = style sheet name
4
node-set = source document for the transformation
5
string2 = XSLT parameter name
6
object = XSLT parameter value-can be XPath expression
7
​

Function returns the result of transformation. Example:

8
1
​
2
<assign>
3
<copy>
4
<from>bpel:doXslTransform("OrderXSLT.xsl", $Order)</from>
5
<to variable="OrderTransformed" />
6
</copy>
7
</assign>
8
​
Section 18

Properties

<vprop:property>

Creates a unique name definition and associates it with an XML Schema type. <vprop:property> is defined in the service WSDL document, not in the BPEL.

3
1
​
2
<vprop:property name="NCName" type="QName"? element="QName"? />
3
​

Example:

3
1
​
2
<vprop:property name="OrderIDNumber" type="ord:OrdIDType" />
3
​

<vprop:propertyAlias>

Maps a property to a field in a specific message part or variable value. <vprop:property> is defined in the service WSDL document, not in the BPEL.

10
1
​
2
<vprop:propertyAlias propertyName="QName"
3
messageType="QName"? part="NCName"?
4
type="QName"?
5
element="QName"?>
6
<vprop:query queryLanguage="anyURI"?>?
7
queryContent
8
</vprop:query>
9
</vprop:propertyAlias>
10
​

Example:

6
1
​
2
<vprop:propertyAlias propertyName="tns:OrderIDNumber"
3
messageType="ord:OrderMsg" part="data">
4
<vprop:query>ord:OrderID</vprop:query>
5
</vprop:propertyAlias>
6
​

bpel:getVariableProperty()

Extracts property values from variables.

5
1
​
2
object bpel:getVariableProperty(string1, string2)
3
string1 - source variable name.
4
string2 - property to select from variable
5
​

Example:

3
1
​
2
bpel:getVariableProperty('Order','ord:OrderIDNumber')
3
​
Section 19

Correlation

<correlationSets>

Correlation set is a set of properties shared by all messages in the correlated group of operations within a process instance. Can be declared within a process or scope, or inline for <invoke>, <receive>, <reply>, <onMessage>, and <onEvent>.

5
1
​
2
<correlationSets>?
3
<correlationSet name="NCName" properties="QName-list" />+
4
</correlationSets>
5
​

Example:

8
1
​
2
<correlationSets>
3
<correlationSet name="Order"
4
properties="ord:OrderIDNumber ord:CustomerID" />
5
<correlationSet name="Invoice"
6
properties="ord:InvoiceNumber" />
7
</correlationSets>
8
​

<correlation>

Correlation can be used on <invoke>, <receive>, <reply>, <onMessage>, and <onEvent>. <correlation> indicates which correlation sets occur in the messages being sent and received. The initiate attribute is used to indicate whether the correlation set is being initiated (yes-initiated, join-initiated if not yet initiated, no-not initiated).

7
1
​
2
<correlations>
3
<correlation set="NCName"
4
initiate="yes|join|no"?
5
pattern="request|response|request-response"? />+
6
</correlations>
7
​

Example:

16
1
​
2
<receive partnerLink="Ordering" portType="ord:OrderPT"
3
operation="PurchaseRequest" variable="Order">
4
<correlations>
5
<correlation set="Order" initiate="yes" />
6
</correlations>
7
</receive>
8
...
9
<invoke partnerLink="Ordering" portType="ord:OrderPT"
10
operation="PurchaseResponse" inputVariable="OrderResponse">
11
<correlations>
12
<correlation set="Order" initiate="no" />
13
<correlation set="Invoice" initiate="yes" />
14
</correlations>
15
</invoke>
16
​

Like This Refcard? Read More From DZone

related article thumbnail

DZone Article

Code Understanding Step by Step - We Need a Task
related article thumbnail

DZone Article

How to Convert XLS to XLSX in Java
related article thumbnail

DZone Article

Automatic Code Transformation With OpenRewrite
related article thumbnail

DZone Article

Accelerating AI Inference With TensorRT
related refcard thumbnail

Free DZone Refcard

GraphQL Essentials
related refcard thumbnail

Free DZone Refcard

API Integration Patterns
related refcard thumbnail

Free DZone Refcard

Getting Started With Cross-Platform Heterogeneous Computing
related refcard thumbnail

Free DZone Refcard

Introduction to Digital Asset Management via APIs

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: