Read Digital Edition


ADS BY GOOGLE
Top Three Links You Must Click On


BPEL in a Service-Oriented Architecture
BPEL's benefits for SOA

Service-oriented architectures (SOA) have gained much attention recently as a unifying technical architecture that can be concretely embodied with Web service technologies. SOA is a design model deeply rooted in the concept of encapsulating application logic within services that interact via a common communications framework. A key aspect of the Web service incarnation of SOA is that the Web service is viewed as a fundamental building block of an SOA-based application.

BPEL, originally called BPEL4WS (Business Process Execution Language for Web Services) is a language for describing Web service orchestration in terms of stateful, long-running interactions consisting of synchronous and asynchronous message exchanges. It supplies a notion of abstract processes to describe externally visible behavior as well as executable processes, which can be run either by some interpreter or by compiling them into some executable form. This article focuses on executable BPEL processes and presents one view on the benefits that BPEL brings to an XML Web service embodiment of SOA principles. BPEL plays an important role in SOA by providing a powerful means by which business logic can be articulated and executed at an abstraction level designed to provide the services needed for integration tasks.

Example: Travel Services
In order to illustrate what problems BPEL addresses and how it relates to SOA, we'll consider an example from the travel industry. Imagine a company offering travel services over the Web. The operations might include:

  • getAvailableHotels: Takes an input of an airport code and returns a list of hotels near that airport.
  • getDescription: Takes an input of a hotel identifier and returns a description.
  • getRate: Takes as input a hotel identifier, the type and number of rooms, and the date and provides a quote for the rate.
  • makeReservations: Takes as input the hotel identifiers, dates to reserve, and room information. Makes the reservation and returns the confirmation number.
  • cancelReservation: Takes a confirmation number and cancels the reservation.
When making a hotel reservation, all of these operations may be called in the process of making a reservation. The messages utilized by these services may be based on vertical industry definitions, such as those provided by the OpenTravel Alliance (OTA; www.opentravel.org). For example, the travel company may write its own WSDLs that rely heavily on the OTA schemas. For simplicity, we will assume that each operation is modeled as a separate service.

Let's consider what happens when we want to create a reusable service that represents some common scenario, such as shopping for a hotel. We will be calling several services, some of which will need to be invoked serially. For example, we need to get the list of hotels near a given airport in order to request detailed descriptions and rates for the hotels. Other services can be invoked in parallel, e.g., once we have the list of hotels, we may want to request descriptions and rates for all of them at once instead of one at a time. Some pieces may require user interaction, such as reviewing the list of options and deciding for which hotel to make the reservation.

We can envision this process as a flowchart consisting of basic activities and structural activities. Examples of basic activities include receiving messages, invoking external services, and assigning values from one message to another. Structural activities may include a sequence that performs nested activities in sequence, and a flow that performs nested activities in parallel. It turns out that this notion of activities is exactly what BPEL provides. In BPEL, the aforementioned activities are receive, invoke, assign, sequence, and flow. Fifteen such activities are defined in BPEL along with non-activity elements such as processes, partner links, variables, and correlations.

Listing 1 shows a brief snippet of how activities might be used in hotel shopping. Details such as data manipulation are omitted for clarity. The point to gain from this is that activities are represented as elements, and subactivities are represented as child elements. Therefore, the structure of XML reflects the structure of the process in an obvious way.

Structured collections of activities such as this can be used to define BPEL processes, which are in turn exposed as Web services; of course, this could also be done in a traditional programming language. So far, the primary benefit we have seen in BPEL is that the notion of interacting with Web services is built into the language. If our focus is almost exclusively on Web service orchestration, it is in some sense more natural to use a language that has these concepts built into it rather than a more general-purpose programming language. Nevertheless, this by itself is not very compelling because there are plenty of libraries that simplify the task of sending and receiving messages with protocols such as SOAP. We will expose more compelling reasons for preferring BPEL in this scenario as we go along.

A WSDL-Centric View of Web Services
Implementing our travel services in a Web service–based SOA implies a decomposition into Web services. A naive implementation of this idea would force the use of SOAP to communicate between all reusable parts of the application, gaining modularity at the expense of efficiency. However, we need not make this trade-off if we are careful about the ontological commitments we make about the notion of a Web service.

The defining technical characteristic of a service from a BPEL standpoint is that it is described in a WSDL. Every message exchange is described in a BPEL process in terms of portTypes and operations defined in the WSDL. BPEL does not assume that services are accessed via SOAP over HTTP, so when appropriate, more efficient bindings may be used. For example, the Apache Web Service Invocation Framework (WSIF) defines WSDL extensions for bindings of local Java invocations, EJBs, JMS, and Java Connection Architecture connectors.

Binding information is not accessed directly in BPEL, but is controlled through deployment configurations. This means that our hotel shopping process can be written in a way that is binding-agnostic, cleanly separating the business logic from lower-level concerns.

Message Exchange Patterns and Stateful Services
Our hotel shopping scenario requires input from the user twice: once to initiate the request with criteria for the city or airport and the dates, and once more to review the offerings and either pick a hotel or cancel the request. Because this input happens twice, the whole service cannot directly be modeled as a simple request/response pair. We have a number of options for how to model this:

  1. The process provides three request/ response operations: getDescriptions AndRates(), makeReservation(), and cancel().
  2. The process exposes a one-way operation to initiate the hotel from shopping. The customer provides a request/response for picking the hotel from the list of choices or canceling.
  3. Each message is modeled as a one-way operation.
About Jim Clune
Jim Clune is a development manager for Parasoft, where he has worked on a number of automated error prevention solutions. His experience with Web services includes the development of testing tools and his most recent project, which is a BPEL runtime engine. Jim holds a BS in engineering from Harvey Mudd College and is working towards a PhD in computer science at the University of California, Los Angeles.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Service-oriented architectures (SOA) have gained much attention recently as a unifying technical architecture that can be concretely embodied with Web service technologies. SOA is a design model deeply rooted in the concept of encapsulating application logic within services that interact via a common communications framework. A key aspect of the Web service incarnation of SOA is that the Web service is viewed as a fundamental building block of an SOA-based application.

Service-oriented architectures (SOA) have gained much attention recently as a unifying technical architecture that can be concretely embodied with Web service technologies. SOA is a design model deeply rooted in the concept of encapsulating application logic within services that interact via a common communications framework. A key aspect of the Web service incarnation of SOA is that the Web service is viewed as a fundamental building block of an SOA-based application.

Thanks, very good article !
I just want to emphasize, in the area where you explain 'Transaction Life', that a result of introducing Compensation handlers, must be (by nature) that these are NOT long-running activities themselves. Fault handling within Compensation handlers, must also be treated with care, otherwise one can end up writing an entire 2-Phase commit protocol.

Thanks for the inspiration I got sofar, though.


  Subscribe to our RSS feeds now and receive the next article instantly!
In It? Reprint It! Contact advertising(at)sys-con.com to order your reprints!
Subscribe to the World's Most Powerful Newsletters

ADS BY GOOGLE

What do the CTO of the U.S. Dept. of Justice and the CIO of the National Reconnaissance Office have ...
The cloud has many benefits, but when it comes to application development, how does the cloud help e...
Data centers today are stretched to the limits with fast-paced business demands. On top of that, int...
Hmm, apparently Samsung has pushed one too many of Apple’s buttons. According to DigiTimes Apple h...
The BYOD trend requires sweeping changes to the way devices are used in the workplace. Find out how ...
SmartBear Software has introduced API Complete, a first-of-its-kind solution that enables software d...
Nearly every enterprise is evaluating cloud computing solutions either today or in the near term. Ma...
A survey of small and mid-size businesses found an interest in harnessing technology to improve busi...
SYS-CON Events announced today that Super Micro Computer, Inc., a global leader in high-performance,...
SYS-CON Events announced today that ScaleMP, a leading provider of virtualization solutions for high...
Come learn real-world examples where cloud and mobile are changing the way business works and the im...
Enterprise IT organizations want to deploy a virtualized data center fabric that will provide the fo...
New tools and services for swift software-as-a-service integration in the cloud lowers the barrier t...
Whether you are a large enterprise, a growing business, a government organization, or a service prov...
How can businesses harness the power of APIs to reach new customers and markets? In his session at...
Facebook Wednesday upped the number of shares that will be sold when it IPOs Friday by almost 25% or...
There was a time, not so very long ago, when IT directors and chief information officers dismissed t...
Called “the biggest software company you haven’t heard of yet” by one of its shiny new backers, 10-y...
Oracle’s Java patent infringement case against Google and Android went to the jury Tuesday afternoo...
You knew this was gonna happen, right? Facebook has repriced its IPO upwards from $28-$35 a share t...