Skip to main content

From business modeling to Web services implementation: Part 1: Modeling a business process

Tilak Mitra (tmitra@us.ibm.com), Certified Senior IT Architect, IBM Global Services
Author photo
Tilak Mitra is a Certified Senior IT Architect in IBM. He specializes in large and medium-sized enterprises and application architectures based on J2EE, MQ and other EAI technologies.

Summary:  Part 1 of this two-part article series introduces you to a sample scenario in which a simple business process is modeled using WebSphere Business Integration Modeler. Part 2 shows how WebSphere Studio Application Developer, Intergration Edition uses the WebSphere Business Integration Modeler artifacts to define Web service definitions. It also helps you understand how to implement the business process using J2EE technologies that may be invoked by any service consumer.

Date:  09 Feb 2005
Level:  Intermediate
Activity:  319 views

Introduction

A typical software development lifecycle begins with an effort to understand the system that is conceived to be built. One of the de facto standard methods that is used for system understanding is to model the business processes that collectively constitute the system's overall functionality. Each business process is an effort to streamline an enterprises' operations and functions. These business process models are then subsequently used by the system architects and designers to come up with a system architecture that is then followed by an instance implementation of the architecture that realizes the business processes.

Business process analysts have used various methods to capture the business process models. Until recently there was a gap between the business process modeling efforts and the system architecture, design, and implementation activities.

A standardized mechanism or language needed to be devised by which the artifacts created during business process modeling could be more readily used during the system design and implementation. This led to the creation of a formal language for business process modeling known as Business Process Execution Language (BPEL). With the advent of BPEL, companies started looking for novel ways to tie the BPEL outputs into the definition of skeleton code artifacts that would then form the base for the declaration of application interfaces and its implementation.

Among the rich set of the IBM® Business Integration Suite of products, the WebSphere® Business Integration Modeler (hereafter referred to as WBI Modeler) and WebSphere Studio Application Developer Integration Edition (hereafter referred to as Application Developer) are two products that aim at tying together the business process modeling and the system implementation efforts by providing support for BPEL. While WBI Modeler support process modeling in BPEL mode, Application Developer has a feature called Process Choreography that utilizes BPEL in order to choreograph business processes and subsequently create Web Services definitions (WSDL) for the BPEL-modeled processes. These Web Service definitions can then be implemented using J2EE™ technology.


What can I expect from this article series?

This article series helps you understand how to create and tie the business process modeling artifacts to the definition of system services and subsequently to its implementations. In doing so, you are exposed to the WBI Modeler tool and how to create a not-so-complex business process workflow. You will subsequently be exposed to the Application Developer tool and learn how to create a Web service definition for the business process that was created using the WBI Modeler and how to invoke the same, all using J2EE technology.

The article series however should not be considered as an elaborate tutorial on learning every single aspect of using the WBI Modeler tool for Business Process Modeling. Neither should this article be considered as a tutorial to learn the entire breadth of the features of Application Developer that allows Process Choreography and Web Service functionality.

This series assumes you have some prior knowledge of WBI Modeler, ideally the latest version (5.1). A decent knowledge of Java™/J2EE development with Application Developer is also required to complete the example used in this article.

Having set the expectations, it's time to start the fun.


Installation prerequisites

For the business process modeling, WBI Modeler (Version 5.1) is used. WBI Modeler comes not only as a standalone product but also as a plug-in for Application Developer. This article uses the WBI Modeler 5.1 plug-in for Application Developer Version 5.1.0.

As far as system requirements, a 1 GB RAM is the minimum requirement; I used a 2 GB RAM machine for this example.

The look and feel and functionality of the standalone as well as the Application Developer plug-in Version of WBI Modeler is exactly the same. My personal preference however is to use the WBI Modeler 5.1 plug-in in WebSphere Studio Application Developer, Intergration Edition. This leaves us with only the Application Developer toolset to work with instead of juggling with two.


Sample scenario

This article uses the following sample scenario as the basis for our problem statement and its proposed solution.

CricketGear Inc, is a small, ficticious company based out of New York that sells sporting goods equipment used for playing cricket. In an effort to make the game popular in the United States, CricketGear wants to create a Web presence that would let potential cricket players surf its site and place orders for equipment. Starting small, the company begins by selling cricket bats and balls over the Web in an effort to spread the name of the game around the country.

CricketGear envisions a business process that lets Web users to submit an order. The requirements for the order are:

  • Calculate the cost of the order.
  • Validate the credit card.
  • Process a payment transaction if the credit card is valid.
  • Save the payment transaction.
  • Send out an acknowledgement with the result/output of the process.

A business process implements a set of business rules, for example:

The payment transaction task will be based on the status of the validity of the credit card task. If the credit card is invalid, the transaction cannot be initiated and the status of the order must be updated to reflect the same.

Although many other business processes can be modeled and subsequently implemented (for example, Ship Order and Process Back Order), this article focuses on modeling and implementing a single business process.


Modeling the process

Various tasks are involved in modeling a business process using the WBI Modeler plug-in (to Application Developer). The high-level steps include:

  • Creating a business modeling project.
  • Creating the business items.
  • Creating the process model (that involves identifying the individual tasks and defining their inputs and outputs).
  • Creating the process flow by connecting the tasks together (as sequential or parallel steps).

The rest of the section illustrates the step-by-step modeling process.

  1. Create a new Application Developer workspace and then open the Business Modeling Perspective in Application Developer.
  2. Create a new business model project with the attributes as shown in Figure 1 below. The Process Catalog is a folder that contains all the processes that you can create. Each process has a name (for example, WebOrder).
    Figure 1. New Business Modeling project
    Figure 1. New Business Modeling project
  3. Select Modeling => Mode => BPEL mode from the main menu to select the BPEL mode. This allows the process to be modeled with only BPEL artifacts so that the final output is BPEL compliant. Also select User Profile => Basic from the main menu (see the two figures below):
    Figure 2. Setting the modeling mode to BPEL
    Figure  2. Setting the modeling mode to BPEL

    Figure 3. Setting the User Profile to Basic
    Figure 3. Setting the User Profile to Basic
  4. Create the business items. Business items represent the business concepts and entities in an enterprise. In our example, business items consist of an Order and a CreditCard. There is another business item that we are going to create that is called RequestData. Before we go any further, you need to know more about RequestData. A task in a process modeled using WBI Modeler can have more than one output. However, if a task is implemented in a language like Java (as a method of a class), the multiple outputs need to be mapped to a complex data object that contains references to the multiple output data types. The process we are going to model has a task that has multiple outputs. Hence, we create a RequestData business item, the contents of which is a reference to an Order business item and a CreditCard business item.
    • Click the Business Item folder. Right-click New => Business Item. Create the Order business item with the attributes shown below. The attribute type can be defined by double-clicking the attributes row and then clicking the button on the extreme right (of the row) that lists the attribute types (refer to the figure for the attributes for RequestData). The attribute types can be basic (for example, Integer, String) or complex data types (for example, the user-defined types like Order and CreditCard)
      Figure 4. The attributes for our Order Business Item
      Figure 4. The attributes for our Order Business Item
    • Create the CreditCard business item with the attributes shown below:
      Figure 5. The attributes for our CreditCard Business Item
      Figure 5. The attributes for our CreditCard Business Item
    • Create the RequestData business item with the attributes shown below:
      Figure 6. The attributes for our RequestData Business Item
      Figure 6. The attributes for our RequestData Business Item

      The attribute types are complex datatypes (for example, Order, CreditCard).

  5. To get a better layout of the perspective, switch to the four-pane layout
    Figure 7. Clicking the encircled palette switches the perspective to a four pane layout
    Figure 7. Clicking the encircled palette switches the perspective to a four pane layout
  6. We now have to create the individual tasks that constitute our WebOrderprocess. In the BPEL editor for the WebOrder process there is a Start (in green) and a Stop (in red & black) node that is added by default. Delete these two nodes before we start drawing the model.

Drawing the model

With the project being created and the Business Items defined, the process model needs to be drawn (with its individual tasks, connections and data input/output types). Use the Task icon from the palette in the BPEL editor to create in the individual tasks. The icon immediately below the Task icon (xxxx) is that of a tower depicting a notification broadcaster. Notice that there will be a small arrowhead (xxxx) on this icon. Click that for a dropdown list of icons. The only icon that should be active is that of a Map. Use this to create a Map that will be a part of our process (as explained below). We will be creating the model in three stages. The first stage is to identify all the individual tasks and any other BPEL artifacts (for example, Map) that can be used. The second stage would be to connect the tasks (and other BPEL artifacts) together thereby determining the workflow of the process. Once this stage is complete, the third stage would be to determine and attach the data inputs and outputs to each of the tasks (and other BPEL artifacts). The three stages are illustrated below.

  1. The figure below depicts the tasks that constitute the WebOrder process. We have also used a Map element. Output of a task may be a complex datatype. In situations where a task requires an input that is contained within a complex datatype, a Map can be used to extract only the required portion of the data from the complex datatype (for example, RequestData).
    Figure 8. The individual tasks identified for our WebOrder process
    Figure 8. The individual tasks identified for our WebOrder process
    The Submit Order accepts the input to the process. The Price Order task prices the order and sets the price attribute of the Order. The Transact Payment task checks the validity of the customer's credit card while the Save Order task saves the order and returns the result of the saving process as the output of the process.
  2. We now connect the model artifacts together in a process flow. The figure below depicts how the process workflow through its individual tasks
    Figure 9. WebOrder process workflow
    Figure 9. WebOrder process workflow
    The BPEL editor has a black bordered boundary. Any connection from the left vertical border denotes an input to the process while a connection that ends in the right vertical border denotes the output result of the process. Note that the input and output connections have an associated String datatype. This is the default datatype that the editor associates with any input and output (of a process) connection. This can be changed later to denote any other datatype. You may notice that the input and output connections to the process cannot be seen together unless the editor is scrolled horizontally. The scrolling can be minimized by clicking the Decrease Horizontally icon in the editor's icon pallete. This can be found in the lower half of the palette and it looks like: xxx
  3. With the workflow of our process defined, we now need to associate the proper input and output datatypes to each task. Drag the RequestData business item from the Business Item folder on top of the input connection element of the Submit Order task. The appearance of a black dotted bordered rectangle denotes that the editor has identified the datatype with the connection. Once you see the black dotted bordered rectangle, you can release the mouse which will then associate the RequestData element to the input connection.

    Repeat the same step for all the connection elements, with the business items as shown in the figure below. The connection between Transact Payment and Save Order has String as the associated datatype. For this, click on the connection element and right-click the mouse to get a list of functions that can be performed. Click on the Associate Data menu. This brings up a dialog box from which the datatype can be chosen. Choose String as the basic datatype. This will associate the String datatype to the connection.


    Figure 10. The WebOrder process model with all connections and inputs and outputs defined
    Figure 10. The WebOrder process model with all connections and inputs and outputs defined
    Notice how the Map element associates the Order to the Price Order task and CreditCard to the Transact Payment task.

This completes the creation of our WebOrder process. The project tree is shown below:


Figure 11. Project Tree representing the artifacts created for the WebOrder business process
Figure 11. Project Tree representing the artifacts created for the WebOrder business process

Processes similar to our WebOrder process can be created under the ProcessCatalog folder. Notice how we have kept the process very simple. We have not associated any Resources or Organizations with our simple process as our idea here is not to create a complex process but to illustrate an end-to-end "process modeling to implementation" of a given simple scenario.


Getting ready for implementation

A BPEL compliant business process model has being created in the previous section. The process artifacts need to be exported out in a format that can be subsequently imported into Application Developer. The imported process artifacts can then be used to create an implementation of the business process.

  1. Right-click on the project name ItsAllAboutCricket in the project tree and choose the Export menu item. This brings up a dialog box containing different modes of export. Choose the mode as shown in the figure below. This allows the exported artifacts to be compliant to a format that can be imported into Application Developer.
    Figure 12. Choosing the WBISF mode as the export format
    Figure 12. Choosing the WBISF mode as the export format
  2. Select a target directory where the process artifacts can be exported and check the Overwrite files checkbox (not shown in figure below).
    Figure 13. Defining a target export directory
    Figure 13. Defining a target export directory
  3. Our process is a short running business process following the request-reply paradigm. Short running processes that run in a single transaction (or without a transaction) are known as microflows. In the subsequent dialog box for the Process execution mode, select Microflow as shown in the figure below.
    Figure 14. Choosing Microflow as our process execution mode
    Figure 14. Choosing Microflow as our process execution mode
  4. Click Finish. An information dialog appears denoting that the project has been successfully exported.

This marks the end of our business process modeling effort. The exported process artifacts are now readily usable for development in Application Developer.


Conclusion

This article took us through a sample business process creation scenario. It showed how a process can be created by defining tasks, inputs, and outputs and how they can be linked into a workflow. It also illustrated how to export the process artifacts created in the WBI Modeler in a manner that can be readily imported into Application Developer and used for the implementation of the business processes.

The next article in this series takes up from where we leave off here. We illustrate how the exported BPEL artifacts can be imported into Application Developer and then how Java-based code can be generated and modified to include business logic. We also show how Web services definitions can be created for the business process and subsequently be invoked by a Java client through a Web service proxy.

As in this article, we will cover a lot of ground in Part 2, so stay tuned!


Resources

About the author

Author photo

Tilak Mitra is a Certified Senior IT Architect in IBM. He specializes in large and medium-sized enterprises and application architectures based on J2EE, MQ and other EAI technologies.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere, Architecture
ArticleID=33654
ArticleTitle=From business modeling to Web services implementation: Part 1: Modeling a business process
publish-date=02092005
author1-email=tmitra@us.ibm.com
author1-email-cc=Copy email address

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers