| By Tilak Mitra | Article Rating: |
|
| June 7, 2005 04:00 PM EDT | Reads: |
26,633 |
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).
- 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.
- 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.
- 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.
- The most important artifacts are WebOrder.bpel and WebOrderInterface.wsdl. They are the subjects of the next two sections.
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.
Published June 7, 2005 Reads 26,633
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By 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.
- Oracle To Keynote Cloud Computing Expo
- Is the PR Business Extinct? Yes
- The Difference Between Web Hosting and Cloud Computing
- Government IT & Cloud Computing: Themes for Discussion
- GovIT Expo Highlights Cloud Computing
- The End of IT 1.0 As We Know It Has Begun
- Cloud Computing Best Practices
- Gang of Four Creates Cloud BI Stack
- The Case for Single-Purpose Services
- VIP Invitation For the GovIT Panel October 6, Washington DC
- Oracle To Keynote Cloud Computing Expo
- How to Diagnose Java Resource Starvation
- Is the PR Business Extinct? Yes
- Anatomy of a Java Finalizer
- IBM & Cloud Computing: Exclusive Q&A
- IBM & Cloud Computing: How "SOA in the Cloud" Can Produce Real Change
- SOA & Cloud Bootcamp: Comparing Cloud Computing Providers
- WebSphere Guru to Keynote at SOA World
- IBM Researcher Solves In-Cloud Data Encryption Puzzle
- The Difference Between Web Hosting and Cloud Computing
- Java vs C++ "Shootout" Revisited
- Where Are RIA Technologies Headed in 2008?
- WebSphere Application Server Java Dumps
- Breaking News: New Internal IBM Report Says "Another Flawed Study"
- Last Exclusive JDJ Interview With "IBM's" John A. Swainson, Now CA's Newly Appointed CEO
- How To Deploy Scalable WebSphere Applications Using "Maven" Build Tool
- Your Guide to Portal Clustering in WebSphere Portal Server 5.1
- Developing Java and Web Services Applications on Rational Application Developer V6
- Automated Deployment of Enterprise Application Updates
- Putting IBM's WAS On Unix - WebSphere Application Server
































