Subscribe to WebSphere: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get WebSphere: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

IBM WebSphere software products Authors: Pat Romanski, Liz McMillan, Yeshim Deniz, hyper filter, Timothée Bensimon

Related Topics: Java EE Journal, WebSphere

J2EE Journal: Article

Using WebSphere Portal to Manage an Order Tracking Process

Using WebSphere Portal to Manage an Order Tracking Process

More than ever, companies need to model and manage their business processes in a way that can integrate systems and people throughout the enterprise, as well as connect with customers and partners. The IBM WebSphere product family delivers those key capabilities to help companies respond with speed to any customer demand, market opportunity, or external threat.

As the foundation of the WebSphere software platform, WebSphere Application Server provides a rich e-business application deployment environment and offers full J2EE 1.3 specification support. The WebSphere Application Server Enterprise Process Choreographer can be used to choreograph all kinds of business processes. The types of business processes can vary greatly, ranging from Web services navigation to business transaction support. Business processes can be automatic, recoverable, or can require human interaction.

WebSphere Studio Application Developer Integration Edition provides J2EE developers and application integration specialists with an integrated development environment for building, testing, integrating, and deploying J2EE applications, business processes, and Web services. With this development tool, developers can model business processes from the Process Editor and test implementations in the WebSphere Test Environment using the embedded Application Server.

WebSphere Portal Server allows people to interact in a personalized way with the on-demand world. It acts as a simple, unified access point to Web applications, permits personalization of Web-based content, and makes it accessible to any device.

In this article we will discuss how to use these products to build, deploy, unit-test, and manage an order tracking process. First, we will create a business process using the Process Choreographer tool in WebSphere Studio Integration Edition, and show how to deploy and unit-test the process in the unit-test environment. Users can use the ready-to-use Process Choreographer Web client to start new processes or to claim and complete an activity in their work list. However, user interfaces for business process applications often require customization, such as adapting the user interface to fit a corporate look and feel, adding content, or introducing new functionality. Hence we will demonstrate how you can easily build a portlet that can integrate with your company portal as well as the order tracking process.

Creating a Part Order Tracking Process
A business process is a multistep operation. The part order workflow will implement the following activities:
1.  Receive a part order request from a customer.
2.  Check the credit card information for the customer.
3.  If the customer has good credit, accept the order request and initiate shipping.
4.  Otherwise, reject the order request.

To create a business process, we first need to create a service project using WebSphere Studio Integration Edition. In the Business Integration perspective, use the Service Project wizard to create a new service project called PartOrder. You can then create a business process using the Process Editor. A typical way to create a business process is to use a WSDL file that describes the business process interface. WebSphere Studio Integration Edition includes a WSDL editor that you can use to create or modify a WSDL file. Using the WSDL editor, create an order.wsdl file that contains the following processPartOrder one-way operation.

<portType name="partOrderPT">
<operation name="processPartOrder">
<input name="inputRequest" message="tns:partOrder"/>

The processPartOrder operation takes an input message partOrder that specifies the following input parameters:

<message name="partOrder">
<part name="customerName" type="xsd:string"/>
<part name="creditCardNumber" type="xsd:string"/>
<part name="expiryDate" type="xsd:string"/>
<part name="item" type="xsd:string"/>
<part name="quantity" type="xsd:int"/>

With the order.wsdl file in hand, you can invoke the Business Process wizard to create the business process, as shown in Figure 1.


The part order business process has a number of activities. An activity represents an operation and can be implemented in many different ways such as an external Web service, a Java class, an EJB, or an EIS. To keep our business process simple, we will implement it using some custom Java code by dragging three Java snippets from the palette and dropping them onto the process. These three Java snippets are shown in Figure 2 as calculatePrice, initiateShipping, and rejectOrder.


Because the part order workflow requires human interaction to call the credit card company to check the customer credit, a Staff activity, checkCreditRating, is added to stop the execution of the process and to solicit human input before proceeding. If the customer has enough funds to pay for the part, the initiateShipping activity will be called to schedule the shipping; otherwise, the rejectOrder activity will be called to send an e-mail to notify the customer.

Unit Test the Business Process
After creating the business process and developing the implementation code, you can use the wizards to generate deployment code. WebSphere Studio Integration Edition provides a built-in unit-test environment that you can use to unit-test your business process. On the server instance on which you have deployed your business process, select Run Process Web client to start the Business Process Execution Web client. Using the Web client you can create a new instance of the business process. As shown in Figure 3, the default Web client prompts you for the input parameters to your business process. These input parameters are obtained from the partOrder message definition in the order.wsdl file.


When you click on the Start Process action, the part order business process will be created, the calculatePrice activity will be executed, and you can use the default screen to enter a "yes" to call the initiateShipping activity or a "no" to call the rejectOrder activity.

Although the default Web client is very useful for quickly testing your business process, most likely it will not be invoked in the same way the business process is invoked in a production environment. Custom applications can be developed to create the business process using one of the generated facades from WebSphere Studio Integration Edition. For example, if you want to launch the business process using a JMS message, you can generate a message-driven bean and send a message to start the business process. Alternatively, an application can also be developed directly using the Process Choreographer APIs. In the next section, we will show how to use this approach to develop customized portlets that can create, claim, and complete activities in the workflow.

Accessing the Business Process Using WebSphere Portal
WebSphere Portal allows people to interact and transact in a personalized way with diverse business resources. It provides a single point of personalized interaction with applications, content, and processes, enabling real-time collaboration. An online retailer can use WebSphere Portal to provide on-the-glass integration and to streamline business processes. For example, a customer can use a part order portlet such as the one shown in Figure 4 to place an order.


When the order is received from the customer, an instance of the business process that we described earlier is created. The first step in the business process is to calculate the final price for the order. This is handled by the calculatePrice activity that was shown in Figure 2.

Once the final price is calculated, a clerk on the retailer side must call the credit card company to make sure the credit card information supplied by the customer is valid. The clerk can use an approval portlet such as the one shown in Figure 5, which shows the list of pending order requests.


The clerk can call the credit card company, validate the customer account, and then approve or reject the order. If the order is approved, the initiateShipping task will be called to send the order to the customer.

Integration Using Web Services
The Process Choreographer component provides a programming interface called the Business Process Service API for developing applications that can be used to control the processes and manage pending work items. The Business Process Service API is a set of methods available through a session bean facade of the Process Choreographer component.

The portlets that we developed run on WebSphere Portal Server 4.2. The business process that we developed runs on WAS Enterprise v5.0. We use Web services to enable seamless integration between the two systems. We developed a JavaBean WFServiceAdapter to wrap the Business Process Service API and use the Web Service wizard to deploy the bean as a Web service on the WAS Enterprise from WebSphere Studio. We also use WebSphere Studio to generate the proxy code used by the Part Order Portlet and the Approval Portlet to invoke the Web service, as shown in Figure 6.


In order to achieve a personalized list of work items in the Approval Portlet, user credentials are required to be passed from the WebSphere Portal Server to the WebSphere Application Server. We enable authentication for the RPC Router on the WebSphere Application Server and pass the username and password to the HTTP transport layer from the portlets. To guarantee the confidentiality of the SOAP message, SOAP over HTTPS is used to send the message from the portal server to the application server.

The WebSphere software platform is organized into three areas of functionality often shown as a pyramid: foundation and tools for building, running, and deploying applications; business integration for integrating internal business processes; and business portals for providing a single point of personalized interaction with applications, content, processes, and people. We have shown you how to use these capabilities together to enhance your business and improve employee productivity.


  • WebSphere Application Server Enterprise Edition: www-3.ibm.com/software/webservers/appserv/enterprise
  • WebSphere Studio Application Developer Integration Edition: www-3.ibm.com/software/awdtools/studiointegration
  • WebSphere Application Server Enterprise Process Choreographer Concepts and Architecture: www7b.boulder.ibm.com/wsdd/library/techarticles/ wasid/WPC_Concepts/WPC_Concepts.html
  • WebSphere Portal Server: www-3.ibm.com/software/genservers/portal
  • Business Process Service API: Click Here!
  • More Stories By Christina Lau

    Christina Lau is a senior technical staff
    member at the IBM Toronto Lab. Christina is the architect and
    manager for WebSphere Studio's XML and data tools.

    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.