Welcome!

SOA & WOA Authors: Yeshim Deniz, Salvatore Genovese, Mark O'Neill, Irfan Khan, Vikas Aggarwal

Related Topics: SOA & WOA

SOA & WOA: Article

Oracle BPEL Process Manager

Making SOA design easy

Service-oriented architecture (SOA), while its underpinnings have been around for years, has recently become one of the most talked about topics in the IT industry. The interest in SOAs is largely due to the emergence of Web services and their ability to expose business applications through well-defined interfaces in a platform-independent manner. While an SOA need not be built using Web services, it certainly presents an attractive option for a variety of environments.

In an SOA, applications are exposed from a process-centric viewpoint. Some examples include services that handle processing credit card transactions, capturing and executing purchase orders, and viewing and updating inventories. The challenge is collecting these independent services into a viable business process. Enter the Oracle BPEL Process Manager (formerly Collaxa BPEL Server). The Oracle BPEL Process Manager provides an environment to design, develop, deploy, and manage the orchestration of independent applications through the use of Business Process Execution Language (BPEL).

The Oracle BPEL Process Manager is distributed with two main components: the server and the designer. The server handles the runtime execution, management and auditing of business processes. The designer, built on the Eclipse platform, provides the IDE for composing and deploying business processes.

Composing Business Processes
Composing a business in the BPEL Designer is a relatively simple process. At the most basic level, the primary tasks to compose a process include choosing whether to build a synchronous or asynchronous process, establishing Partner Links with services to be executed, linking the services together using Assign operations, establishing any control flow and special processing requirements, and gathering the necessary results for the endpoint.

For the purposes of this review, I will be creating a simple asynchronous business process that performs the following steps:

  1. Accept the name, postal address, and e-mail address of a user.
  2. Look up the current weather forecast for the user by zip code.
  3. Download information about the address the user has provided.
  4. Send an e-mail with the collected data to the user's provided e-mail account.
The system will incorporate publicly available Web services to get the weather forecast and address information. The e-mail will be sent from a Java application exposed as a stateless session bean.

As mentioned earlier, the Partner Links to the weather and address services must be established. Using the Add Partner Link wizard in the IDE, WSDL files of desired services may be downloaded into the process model. Developers may enter a URL to a WSDL file or browse a UDDI server to select the appropriate service. If the WSDL file provided does not define a partnerLinkType, the designer will automatically create a wrapper.

Once the Partner Links are established, the development of the actual flow within the business process may be done. Figure 1 shows the complete business process in the BPEL Designer. An instance of the business process is created when a SOAP message is received by the BPEL Server. The first yellow icon in the figure represents the Assign operation that extracts data from the received SOAP document and places it in the appropriate XML structures for both the Weather and Address services. The Assign operator in the BPEL Designer supports XPath queries, XPath expressions, BPEL XPath extension functions, Collaxa XPath extension functions, and custom XPath extension functions. It should be noted, however, that according to Collaxa's documentation, due to the complicated nature of developing transformation logic in the Assign operator many users of the BPEL Designer offload complex data transformation to Web services or Java applications that utilize XSLT and/or XQuery.

The next group of icons illustrates the parallel processing capabilities of the BPEL server. Since the weather and address services are independent of each other, they may be run simultaneously. After the Assign operation has mapped the SOAP message to the appropriate inputs for each service, they are executed. Any remaining tasks within the business process are put on hold until all elements within a parallel processing group have completed.

Once the weather and address services have returned, the e-mail service is executed. Since the e-mail service is exposed in the form of a stateless session Enterprise JavaBean, the Exec function is used. The Exec function is part of the namespace that defines the Collaxa-specific BPEL extensions. This tag allows the developer to write the Java code necessary to execute the e-mail service directly into the BPEL document.

Finally, the last Assign operator places a hard-coded success message in the response payload of the business process, which in turn is sent to the calling process via an asynchronous callback. (Note: The result of either of the Web service calls can just as easily be returned to the client).

Advanced Business Processes
In real-world scenarios, business processes typically include complicated logic for handling exceptions and gathering input from users. To that end, Oracle's BPEL Process Manager provides mechanisms to handle both. Notice that in Figure 1 there are two vertical labels - one blue (indicating it has the current focus) and the other gray. These labels and the boxes to which they are attached represent the BPEL Designer concept of Scope. Scope is analogous to a general code block prevalent in most programming languages and specifically related to the try/catch structure in Java. Business process logic may be attached to Scope definitions to handle message faults, perform compensating transactions, execute logic when messages are received, and execute logic when a long-running process reaches a predetermined timeout. This allows for the graceful recovery from errors and provides additional monitoring capabilities by responding to important events.

The Oracle BPEL Process Manager also contains a User Task element. 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.

Summary
As the development of applications continues to shift toward the process-centric viewpoint, the need to easily piece these components together to form a larger business process increases. Oracle's BPEL Process Manager is a very strong option for meeting this need. The designer provides the tools necessary to create complex business processes while the server delivers excellent management and auditing capabilities. Overall, the Collaxa BPEL Server is a very capable product and should be considered when building service-oriented architectures.

Oracle

Company Info
Oracle Corp.
500 Oracle Parkway
Redwood Shores, CA  94065
1-800-ORACLE1
United States Support Sales Phone: 1-800-833-3536

Collaxa, Inc.
1600 Bridge Parkway
Redwood Shores, CA 94065
Phone: (650) 801-6250
Fax: (650) 801-6251

More Stories By Brian Barbash

Brian R. Barbash is the product review editor for Web Services Journal. He is a senior consultant and technical architect for Envision Consulting, a unit of IMS Health, providing management consulting and systems integration that focuses on contracting, pricing, and account management in the pharmaceutical industry.

Comments (0)

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.