YOUR FEEDBACK
Restoring the "Delegate" Concept To Java
Black007_pl wrote: Hi! I don't really see the point of using delegates in ja...
SOA World Conference
Virtualization Conference
$50 Savings Expire May 23, 2008... – Register Today!

SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


From Business Modeling to Web Services Implementation
Part 2 - Implementing a Web Service for a Business Process

Digg This!

Page 1 of 3   next page »

Part 1 of this article illustrated how to use WBI Modeler 5.1 to model a business process. We used the example of a simple "Web Order" business process and showed how it can be modeled in a BPEL-compliant mode. The artifacts created in Part 1 were exported into the file system for use as the input to the business process implementation - the topic of this article.

In this article we're going to explain how to add business logic to each individual task that comprise the business process and subsequently expose the entire business process as a Web Service. As part of the end-to-end process, we're going create a Web Service proxy that can be used by a service consumer to test the entire business process.

It's strongly advised that you complete the business process modeling exercise in Part 1(WebSphere Journal, Volume 4, issue 4) before going through the hands-on exercise illustrated in this section since it's the prerequisite for this article.

Setting up the Project
This section illustrates the creation of a new Service Project in WebSphere Studio Application Developer Integration Edition (WSADIE) and imports the output artifacts of the business modeling exercise (in Part 1).

  1. Open WSADIE and create a new workspace. Switch to or open the Business Integration Perspective. We're going to create a new Service Project. A service project contains the files that collectively represent an enterprise service or process. Right click on the Service Project folder and create a new Service Project (New->Service Project). Enter the name of the new project as shown in Figure 1 and click Finish.
  2. The contents of the process (exported) from the modeler (in Part 1) need to be imported into the newly created CricketOnline project. Right click on the newly created project and click the Import menuitem. In the dialog box that appears, highlight File System and click Next. Browse to the directory where the artifacts from the business process modeling exercise issue were exported. Check the folder contents as shown in the Figure 2 and click Finish. This imports the business process into our newly created project.
  3. The project contents looks like the Figure 3. Notice how each of the business items created during process modeling has a Java class representation in the Businessitems folder. The BusinessItems.xsd is an XML representation of the business items.
  4. The most important artifacts are WebOrder.bpel and WebOrderInterface.wsdl. They are the subjects of the next two sections.
Anatomy of WebOrder BPEL
Each process that's modeled during the business process modeling effort manifests itself as a BPEL file. The format of the file is <process_name>.bpel where process_name is the name of the process that was modeled. In our scenario, we only modeled one process WebOrder and hence we have a file WebOrder.bpel in the ProcessCatalog.WebOrder folder. Double-clicking the bpel file opens it up in the process editor. (See figure 4.)

The process flow looks like the one we modeled in Part 1 except for the few a extra elements that appear in its representation in WSADIE. WebOrder Receive represents the input elements that trigger the process initiation. WebOrder Reply represents the output of the process. Between the individual tasks there are Assign elements. There's also a list of variables that are used in the business process.

Variables store the messages that are used by a business process. The message within the variable is defined using a WSDL message type that's made up of one or more message parts.

An Assign element is used to map the output of a task to the input of a subsequent task. The Assign activity is used to copy values from one variable to another. The Assign activities in our WebOrder business process have already been set and they don't need to be changed unless the process flow has to be altered.

Figure 5 shows how an Assign activity copies the output of one task to the input of a subsequent task by copying the message parts of variables. (The Assign activity in the Figure 5 copies the output of the Price Order task to the input of the Save Order task. Clicking on an Assign activity displays its properties in the editor pane).

Notice how the Order message part of PriceOrderOutputCriteriaVariable is mapped to the Order message part of SaveOrderInputCriteriavariable. Examining each of the Assign activities helps in understanding how the various tasks are linked together in a business process.

Each task in the process is associated with a partner link. Partner links identify the parties that interact with the business process. A partner link defines operations that can be implemented internally or may even map to operations in external Web Services that may be invoked to fulfill the task. Clicking on a partner link shows the task it's associated with.

Our business process has all the necessary Variables and Assign activities defined and mapped.

Anatomy of WebOrderInterface WSDL
Each business process that can be created in the business modeling step (Part 1) has a corresponding interface definition file (in WSDL format). The WSDL contains a list of Messages and Port Types among other elements. Figure 6 denotes the contents of WebOrderInterface.wsdl.

The Messages are used to construct the Variables that are used to copy values between inputs and outputs of individual tasks as the process flows from one task to another.

A port type is a named set of abstract operations and messages involved.

Each operation refers to an input message and output messages.

Figure 7 illustrates how the variables of PriceOrderPT are composed of messages that encapsulate the input and output parameters.

Each port type representing a task in our business process needs to be implemented to satisfy the business logic that it's responsible for carrying out. In the next section we'll take the imported artifacts and generate and create implementation code that provides the overall implementation of our business process.

Process Implementation
There are a few steps that need to be executed in sequence to implement our business process.


Page 1 of 3   next page »

About Tilak Mitra
Tilak Mitra is a Certified Senior IT Architect at IBM. He specializes in mid- to large-range enterprise and application architectures based on J2EE, MQ, and other EAI technologies. You can reach him at tmitra@us.ibm.com.

WEBSPHERE LATEST STORIES . . .
Red Hat Named "Platinum Sponsor" of Virtualization Conference & Expo
Red Hat is a trusted open source provider. Red Hat offers enterprise customers a long-term plan for building infrastructures on the quality and innovation of open source. Combining open source operating system platform, Red Hat Enterprise Linux, together with applications, management
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in midtown
Microsoft's Mike Neil To Keynote SYS-CON's 4th International Virtualization Conference & Expo
Mike Neil is general manager for virtualization strategy in the Windows Server Division at Microsoft. Mike is focused on the delivery of the Windows virtualization technology, including Windows Server 2008 Hyper-V, Microsoft Hyper-V Server and Virtual PC 2007. Mike also directs the tec
IBM Unveils Insurance Operations of the Future Powered By SOA
IBM announced two new advances in the insurance industry - a solution for improving operational efficiency and a framework for process acceleration - that are designed to help insurance providers lower costs and increase customer satisfaction by handling core processes, such as claims
ParAccel Announces OEM Relationship with IBM
ParAccel announced it has entered into an original equipment manufacturer (OEM) agreement with IBM. Under the terms of the agreement, ParAccel will embed IBM InfoSphere Change Data Capture within the ParAccel Analytic Database, providing ParAccel customers with seamless and real-time u
Micro Focus Upgrades SOA Express for IBM CICS
Micro Focus announced the availability of SOA Express 8.0. The new version adds support for direct deployment into IBM's Customer Information Control System (CICS), enabling users to accelerate the deployment of Web services by reusing their existing CICS TS mainframe infrastructure in
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING WEBSPHERE NEWS
Devon IT Launches New SafeBook LVO Mobile Thin Client Built on Lenovo R61 ThinkPad Platform
Devon IT, Inc., an alternative desktop solution company and the fastest growing provide