Welcome!

SOA & WOA Authors: Patrick Carey, Greg Akers, Richard Moulds, Elizabeth White, Pat Romanski

Related Topics: SOA & WOA

SOA & WOA: Article

BPEL4WS 1.1 To WS-BPEL 2.0 - An SOA Migration Path

BPEL4WS V1.1 has several shortcomings that will be addressed by the next release of the specification

BPEL4WS V1.1 is a public draft release of the "Business Process Execution Language for Web Services" specification dated May 3, 2003. BPEL4WS V1.1 is arguably the de facto standard for Business Process Management (BPM); however, because it's a draft release, BPEL4WS V1.1 has several shortcomings that will be addressed by the next release of the specification (named WS-BPEL 2.0), which is targeted to be released either toward the end of this year or during the beginning of 2006.

WS-BPEL 2.0, henceforth referenced as BPEL 2.0, is considerably different from the previous V1.1 draft release. The article will address these changes and demonstrate how to attempt to migrate a V1.1 business process to be compatible with a BPEL 2.0 engine. Sometimes this migration is simple and can be accomplished by means of syntactic changes to the process; sometimes the migration is not so easy, and mostly results in the rewrite of the process or process fragment. We will start with the simple cases and move toward the more complicated ones.

It is not the intention of this article to explain BPEL 1.1 or to explain the new features of BPEL 2.0, so it is highly recommended that the reader have a good familiarity with the BPEL language.

BPEL 1.1 Features That No Longer Exist
We will first address those features that have been removed from BPEL 1.1. The concept of "partner" is no longer available for BPEL 2.0. A "partner" groups several "partnerLinks," and in doing so represents a common endpoint. Aside from being descriptive, the "partner" concept did not have any executable property, so it was decided that the language did not need this concept.

The XML element "compensationHandler" and the XML attribute "enableInstanceCompensation" in the top-level "process" element have been removed. Instance (process) level compensation handlers never had any mechanism for being invoked; therefore, because they could not be used instance level compensation handling is no longer supported.

Since it is very unlikely that any BPEL 1.1 engine made use of either of these concepts, it is generally safe enough to just remove them from the process definition when migrating to BPEL 2.0.

Syntactic Changes
The following changes are just syntactic. You can simply do a simple find-and-replace to migrate to BPEL 2.0:

  • Replace the XML attribute "variableAccessSerializable" with "isolated"
  • Replace the XML tag "terminate" with "exit"
  • Replace the XML attribute "onMessage" of event handlers with "onEvent"
  • Move the XML attribute "joinCondition" that is present in BPEL activities to be a child element of "targets," as in the following XML fragment:
    <invoke name="settleTrade">
       <targets>
         <joinCondition>
           $buyToSettle and $sellToSettle
         </joinCondition>
         <target linkName="buyToSettle"/>
       </targets>
    </invoke>
  • Replace the XML attribute value "rendezvous" of the attribute "initiate" with the attribute value "join"
  • The schema type "tRole" no longer has a child element representing the port type; instead, the port type is now specified as an attribute directly in the role itself, as demonstrated in the following fragment:
    <plnk:partnerLinkType name="shippingLT">
       <plnk:role name="shippingService"portType="shippingServicePT"/>
    </plnk:partnerLinkType>
  • The attribute "portType" of messaging activities such as "receive," "invoke," "reply," "pick," and "onEvent" is no longer mandatory and can be omitted
  • The URI used to specify XPath 1.0 as the expression/query language of choice has been changed, so replace the attribute value "http://www.w3.org/TR/1999/REC-xpath-19991116" of the attributes "expressionLanguage" and "queryLanguage" with the attribute value "urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"
In addition to these, the syntax for assignments has been changed, but we will discuss this in a separate section.

Extensibility of Expression/Query Languages
In BPEL 1.1 expressions are used by switch conditions, while conditions and assignments such as XPath expressions are constrained as being an XML attribute value. Although this is not generally a problem for XPath 1.0 expressions, it is awkward for more complex languages such as XPath 2.0 or XQuery 1.0. XML attributes do not provide enough "real estate" for complicated expressions and also do not allow for the use of other XML features such as CDATA, or to write XML itself as the expression.

Hence, to allow for better extensibility of BPEL using external languages, the authoring of expressions and queries are now realized within XML tags (elements) instead of attributes. In practice this means that the XML attributes "for," "until," "joinCondition," "transitionCondition," "expression," "query," and "condition" must all be changed to be XML elements, which would then contain the expressions (the expressions are the former attribute values). The following snippet shows an example of this conversion for XPath 1.0. Note that the attribute "expressionLanguage" is optional.

<while>
   <condition
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
$itemsShipped < bpws:getVariableProperty('shipRequest','sns:itemsTotal')
   </condition>
   <sequence>
     <!- do something -->
   </sequence>
</while>

Listing 1 shows an example of a nonstandard usage of XQuery 1.0 as the expression language. BPEL 2.0 has thus far only standardized the usage of XPath 1.0.

Links
Links are used to specify synchronization dependencies between nested activities within a flow. In BPEL 1.1, links could not cross the boundary of structured activities such as "while," "isolated scope," "event handler," and "compensation handler." In BPEL 2.0, this restriction has been made stronger. Links that create a reentrant control path in scopes are no longer permitted. The reason for this tightening is to simplify the semantic of compensation handling. Figure 1 illustrates this banned scenario.

Messaging
Several aspects of messaging for BPEL 1.1 are unspecified. For example, there is no defined behavior for a process that receives a message for a request-response operation and finishes without replying. In BPEL 2.0, such a scenario would have trigged a new BPEL standard fault called "missingReply" fault.

More Stories By Alexandre Alves

Alexandre Alves currently works at BEA Systems, in the WebLogic Integration group. He has worked with integration technologies for over 10 years, focusing on CORBA, J2EE, and Web services.

Comments (1) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
SOA Web Services Journal News Desk 11/30/05 09:11:36 PM EST

BPEL4WS 1.1 To WS-BPEL 2.0 - An SOA Migration Path. BPEL4WS V1.1 is a public draft release of the 'Business Process Execution Language for Web Services' specification dated May 3, 2003. BPEL4WS V1.1 is arguably the de facto standard for Business Process Management (BPM); however, because it's a draft release, BPEL4WS V1.1 has several shortcomings that will be addressed by the next release of the specification (named WS-BPEL 2.0), which is targeted to be released either toward the end of this year or during the beginning of 2006.