Home > SOA Tips > The Web Services Advisor > BPEL: Web Services orchestration, hands-on with ActiveBPEL
SOA Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

THE WEB SERVICES ADVISOR

BPEL: Web Services orchestration, hands-on with ActiveBPEL


Daniel Rubio
11.21.2005
Rating: -4.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Designing Web services in the context of an SOA entails striking a balance between a series of issues -- mainly reusability and flexibility -- but once this initial design is done coordinating individual services to play out their role in an aggregated manner implies another set of requirements, most of which can be addressed through BPEL, Business Process Execution Language.

BPEL was created as a joint effort by IBM, Microsoft and BEA in 2003, but since its inception, BPEL has gained traction among Web services standards. Currently under the auspices of OASIS and in its 2.0 version, more than thirty five companies are shaping the future direction this standard will take in addressing Web services orchestration.

But what does Web services orchestration through BPEL, or as some other companies term it Web services workflow or choreography, mean for someone already using the basic Web services stack SOAP/ WSDL/ UDDI? Lets tackle the issue, assuming you are assigned the task of migrating a credit application system and enabling it with Web services.

By its very nature, our credit application will surely be interacting with third party systems and in this same process have tens or hundreds of call variations based on these same Web services that need to be fulfilled in order to satisfy the requirements made by different system users.

Structuring these Web services decision chains or workflows is what BPEL has been designed for. However, before we delve further into its concrete use, you should be aware of one important aspect, perhaps even prerequisite, to realizing the value proposition behind BPEL: Reusability.

In order to structure as many Web services-based business processes and glue them together with BPEL a very fine balance needs to be achieved on each individual service. Having coarse-grained Web services may defeat the whole purpose of using BPEL for creating different decision chains since they may be complete bu


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
BPEL
BPELTutorial
Co-evolution of BPMN and BPEL drives BPM in SOA settings
UML modeler includes BPMN support
BPM Special Report: What you model is what you monitor
Verizon uses BPEL app to cut down on code, check for fraud, and go green
Visual orchestration tool addresses event processing and SOA
SOA, BPEL working on the railroad
UML and SOA the Microsoft way
Oracle links SOA, data services, BI and BAM
Online real estate SOA moves into BPEL
BPEL Research

The Web Services Advisor
Use SoaML to facilitate Model Driven Architecture
Enterprise mashup patterns act as API enablers
XQuery learns to write using XUF
Descriptive Languages for RESTful Services
Notable Python language update on view
Try XML-based Extensible Business Reporting Language (XBRL) for accounting reports
Whatever happened to ''X''?
The technology of Web Service Security
Thrift: A pragmatic approach to service integration
What's new at the W3C

SOA strategy
Three tips for success in SOA
New Microsoft language for SOA?
Trends 2008: Outsourcing, agile development
Is SAP the SOA leader?
SAP new SOA strategy debated
Goldman sees hard times for software
SAP offers two paths to SOA
Fusion SOA touted by Larry Ellison
Oracle Fusion goes Enterprise 2.0
Analysts ponder Microsoft-oriented architecture
SOA strategy Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
BPEL  (SearchSOA.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


siness processes unto themselves. Similarly, fine-grained services may prove unwieldy to reuse and structure with BPEL workflows.

This process is similar in nature to that of object-orientated design, where an object needs to do enough work to justify its existence while holding off from trying to be an Über-object. You should think of Web service design in the same fashion. As a matter of course, Web service reusability is one of SOA's primary tenets, but the case proves more evident when using BPEL as we will see shortly.

At its core, BPEL provides the necessary XML grammar to express Web service interactions and as such has provisions for declaring variables, flow control, transactions and error handling among other things you would expect from a language charged with orchestrating cooperation.

Since this also implies a paradigm shift from the basic SOAP/WSDL/UDDI approach to Web services, BPEL requires its own environment in which to execute these instructions, properly named BPEL engine.

Currently, BPEL engines vary in maturity and deployment complexity. While some vendors in the SOA landscape are tightly integrating their BPEL engines with other core offerings such as ESB's - a term loaded with controversy to say the least - others are creating standalone products in this same space.

In order to obtain a firm grasp on BPEL we will take the latter approach and exemplify BPEL through the most neutral and non-invasive approach possible, a Java open source BPEL engine named: ActiveBPEL.

ActiveBPEL, being a standalone BPEL engine, is designed to operate under any Java/J2EE application server in the form of a Web application (WAR file). Given ActiveBPEL's roots in open source, it has strong ties to the de facto Java/J2EE open source container Tomcat , Apache's Web services framework Axis and the popular build tool Ant .

These characteristics make ActiveBPEL an excellent alternative for exploring BPEL's functionalities since its operation depends on well known and readily available technologies. In case you don't have these packages on your workstation, download them and follow the basic installation instructions. We wont stray into fancy configurations, since the whole point of this choice is to get you up to speed on BPEL as quickly as possible.

Let's take a high-level view at the orchestration process we will be trying to achieve through ActiveBPEL. Your banking system needs to execute a credit application process that returns either a simple "yes" or a "no" based on a series of elaborate chained decisions that are taken from such things as the amount of a loan, a solicitor's credit history or a branch location, all of which are fulfilled by calling individual Web services.

Due to market conditions or bank policies this business process will more than likely change the manner in which it qualifies or disqualifies a credit application. Having an Über Web service that returns the results would be an extremely inflexible approach since it would imply continuous modification to the business logic behind the Web service each time a modification is required. On the other hand, having a BPEL process orchestrate the application logic gives us two main benefits.

BPEL's XML grammar grants us a level of indirection in which to alter the application's workflow without the need to modify behind the scenes business logic while also leaving us the door open for later reuse of a set of core Web services in more complex workflow scenarios.

Let's assume we have arrived at a final design -- the difficult part -- for our core Web services. Our two Web services will be composed of an approver and an assessor. The initial analysis shows that both can easily be reused for other credit evaluation processes. So now it's time to look at BPEL pseudo-code and see what we need to create in BPEL-XML syntax.

Our first step is checking the credit application amount. If this quantity is above a $10,000 threshold we hand of the input data to the approver Web service in order to obtain a response. On the other hand, if the application amount is below $10,000 we first invoke the assessor Web service, at which point, after returning an answer, if the response is "lowrisk" the application is immediately approved. Otherwise we need to make a further call to the approver Web service.

This is a very straightforward business process for our application, but one that clearly illustrates the power BPEL can achieve orchestrating different calling scenarios to our core Web services. Now lets take a look at the actual BPEL-XML syntax.

Source: Loan Approval Application for ActiveBPEL

Notice the various BPEL elements : <partnerLink>, <variable>, <faultHandler>, <flow>, >target>, among others. Obviously going into an exhaustive description of BPEL syntax would go beyond the scope of this article, but if you follow closely you will see the same patterns described in our pseudo-code. It should also be noted that most BPEL process are created using special editors in order to avoid the error prone process of writing XML by hand.

Having seen the actual BPEL process you might now be asking yourself were is the relation to our actual Web services -- the URI's, or WSDL descriptors? In the specific case of ActiveBPEL, this requires you define a Process Deployment Descriptor file which tells the BPEL engine about your processes. The following section shows this PDD file.

Source: Loan Approval Application for ActiveBPEL

Notice how this descriptor associates the location of the BPEL process we saw earlier in the declaration <process location="bpel/loanapproval.bpel"> defines physical addresses for each <partnerLink> and declares various WSDL descriptors.

In essence, this last file ties together the BPEL process with our actual Web services. With this last illustration, you should also realize that Web services WSDL files form the backbone of any BPEL process.

The previous statement holds true because WSDL contracts describe the methods, messages and characteristics of a Web service. And a BPEL process, through its engine, makes ample use of the information contained in these standard Web services documents in order to orchestrate the desired business process.

That concludes our look at BPEL through ActiveBPEL. Having looked at the Loan Approval Application for ActiveBPEL and addressed its inner workings, you should now be in a position to realize the value BPEL can bring to your Web services and SOA developments.

About the Author

Daniel Rubio is an independent technology consultant specializing in enterprise and Web-based software, He blogs regularly on these and other software areas at http://www.webforefront.com.






Rate this Tip
To rate tips, you must be a member of SearchSOA.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



SOA Trends and Strategy - SOA Education, SOA Development, SOA Implementations
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2001 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts