IBM BPM V7.5 orchestration scenarios, Part 2: Straight through processing using IBM Integration Designer

Part 2 of this series shows how to create a straight through processing application using a BPEL process in IBM® Integration Designer. In a straight through processing scenario, the business process contains no human intervention.

Share:

Ashok Iyengar (ashoki@us.ibm.com), Executive IT Specialist, IBM China

Ashok Iyengar photoAshok Iyengar is a member of IBM for Software Services for WebSphere (ISSW). He has worked extensively with the IBM Business Process Management platform doing proof of concepts, pilots, and architecture design. Currently his focus is on the cloud, specializing in Platform as a Service (PaaS). He helps customers deploy patterns on IBM PureApplication Systems and IBM SmartCloud.


developerWorks Contributing author
        level

Mangalaganesh Balasubramanian (mbalasub@au1.ibm.com), IT Architect, IBM

Photo of Mangalaganesh BalasubramanianMangalaganesh Balasubramanian is an IT Architect with IBM Software Services for WebSphere. Manglu has been consulting with companies in the Asia Pacific region for more than 14 years. He specializes in the Business Process Management space, particularly with solutions based on WebSphere Process Server and WebSphere Lombardi Edition.



02 November 2011

About this tutorial

This tutorial shows you how to create a straight through processing application in IBM Business Process Manager (BPM) V7.5 Advanced. Simply put, in a straight through processing scenario the business process contains no human intervention. In this tutorial, you will implement the straight through process using a Business Process Execution Language (BPEL) process in IBM Integration Designer (hereafter called Integration Designer).

Objectives

In this tutorial, you will learn how to:

  • Create the interface and business process in Integration Designer.
  • Wire the business process and interfaces.
  • Build and test the process application.

Prerequisites

You need to be familiar with business processes.

System requirements

  • Windows® XP or Windows Vista® or Windows 7
  • IBM Integration Designer V7.5.0.1 Advanced that can connect to Process Center V7.5.0.1

Duration

This tutorial will take about 2 hours to complete.

This tutorial has three parts:

  • In Part 1, you work with Integration Designer to create a BPEL process.
  • In Part 2, you assemble the application components.
  • In Part 3, you test the BPEL process.

Part 1: Working with Integration Designer

Start by bringing up Integration Designer to implement a BPEL-based business process.

  1. Launch Integration Designer. In the Workspace Launcher window, enter a workspace name, such as C:\IBM\workspaces\STP, as shown in Figure 1. Click OK.
    Figure 1. Selecting a workspace
    Selecting a workspaceNote: Do not check the box that says “Use this as the default and do not ask again”.
  2. If you get the Process Center Login screen, you have the choice to enter the Process Center connection details or to click Cancel. If you click Cancel, you will be taken directly to the Business Integration perspective.
    1. Enter the Process Center URL as http://localhost:9080/ProcessCenter, as shown in Figure 2.
    2. Enter the appropriate credentials, such as bpmadmin/bpmadmin. Click Login.
      Figure 2. Process Center login
      Process Center login
    3. If a Getting Started screen is displayed, close it.
    4. Make sure you are in the Business Integration perspective, which is the default perspective in Integration Designer. You can continue to the next section to create a library.

Create a library

  1. In the navigation pane of the Business Integration perspective, click the link to add a business integration project and select Library as shown in Figure 3. Or, you may right-mouse click and choose File > New > Library.
    Figure 3. Business Integration Project Type selection
    Business Integration Project Type selection
  2. Specify a library name, such as STPLibrary shown in Figure 4. Click Finish.
    Figure 4. Creating a library
    Creating a library
  3. A Library project folder is created where you can store resources (like Data Objects and interfaces) that can be shared by other libraries or project modules.

Create an interface

  1. Highlight the STPLibrary folder, right-mouse click, and choose New > Interface.
  2. Specify an interface name, such as ManageRequest shown in Figure 5. Click Finish.
    Figure 5. Creating an interface
    Creating an interface
  3. The new interface is displayed in the Interface Editor where you can add operations. You will add an operation that takes a request and returns a response.
  4. Click the icon as shown in Figure 6, or right-mouse click and choose Add Request Response Operation.
    Figure 6. The interface editor
    The interface editor
  5. Change the operation name from operation1to CancelRequisition by typing over it.
  6. In the Operations menu bar, click the green arrow icon twice to add two more inputs (see Figure 7).
    Figure 7. Adding inputs to an operation
    Adding inputs to an operation
    1. Change the name of input1 to firstName. Leave the default type as string.
    2. Change the name of input2 to lastName. Leave the default type as string.
    3. Change the name of input3 to requisitionNumber. Leave the default type as string.
    4. Change the name of output1 to result.
    5. Change the result type to boolean by clicking on string in the Type column and selecting boolean.
    6. Click Ctrl+S to save the edits. The result is shown in Figure 8.
    Figure 8. The CancelRequisition interface
    The CancelRequisition interface

Add another interface

  1. Similarly, create another interface called Notify.
  2. Click the icon or right-mouse click, and choose Add One Way Operation. Name the operation NotifyCancellation.
  3. In the Operations menu bar, click the green arrow icon twice to add two more Inputs.
    1. Change the name of input1 to emailID. Leave the default type as string.
    2. Change the name of input2 to requisitionNumber. Leave the default type as string.
    3. Change the name of input3 to cancellationReason. Leave the default type as string.
    4. Since this is a one way operation, there is no output parameter. Click Ctrl+S to save the edits. The result is shown in Figure 9.
      Figure 9. Adding an operation
      Adding an operation

Create a module

  1. In the navigation pane of the Business Integration perspective, right-mouse click and choose New > Module.
  2. Name the module STP, as shown in Figure 10. Click Next.
    Figure 10. Creating a module
    Creating a module
  3. Select STPLibrary from the list of available libraries so you can use the interfaces that it contains, as shown in Figure 11. Click Finish.
    Figure 11. Select a library
    Select a library
  4. After the module project is created, the Assembly Editor is displayed. You may close it for now.

Create the BPEL Process

  1. Expand the STP project folder. Highlight Integration Logic, right-mouse click, and choose New > BPEL Process.
  2. Name it CancelRequisition, as shown in Figure 12. Click Next.
    Figure 12. Create a BPEL process
    Create a BPEL process
  3. Remember a straight through process is one that does not involve humans, hence we chose Microflow from the BPEL Process Type Selection screen (Figure 13). Click Next.
    Figure 13. Select BPEL Process Type
    Select BPEL Process Type
    1. Choose the option to Select an interface.
    2. Browse for the ManageRequest interface that you created earlier. When you select it, the operation is displayed.
    3. Choose the operation named CancelRequisition, as shown in Figure 14. Click Finish.
      Figure 14. Select an interface
      Select an interface
    The process artifacts are created and the BPEL Process Editor is displayed with a skeletal flow containing the Receive and Reply nodes. Also notice the “Interface Partner – ManageRequest” that got created, as shown in Figure 15.
    Figure 15. BPEL Process Editor
    BPEL Process Editor
  4. From the palette on the left, drag an Invoke activity and drop it between the Receive and Reply nodes. Change its name to Notify Admin by typing over the default name.

Notice that there is no partner set for the invoke activity. You will do that next.

Create a Reference Partner

  1. Click the plus sign next to Reference Partners in the BPEL Editor. Name it NotifyPartner.
  2. Select the Notify interface, as shown in Figure 16. Click OK.
    Figure 16. Add a reference partner
    Add a reference partner

    Tip: You can also drag the interface directly on to the BPEL Editor, under "Reference Partners".

  3. Highlight the new invoke activity: Notify Admin. In the Properties tab, go to the Details section.
    1. For Partner, click the Browse button and select the new reference partner: NotifyPartner.
    2. Choose the operation: NotifyCancellation.
    3. Make sure Use data type variables mapping is selected.
    4. You will need to map three variables to the Inputs required for the NotifyCancellation operation. This is done in the Read from Variable column.
      1. Click none next to emailID. Choose New and specify a name such as emailIDvar.
      2. Click none next to requisitionNumber and choose the existing requisitionNumber variable.
      3. Click none next to cancellationReason. Choose New and specify a name such as cancelReasonvar.
      4. Click Ctrl+S to save the edits.

    The updated business process with the reference partners and variables is shown in Figure 17.

    Figure 17. Updated BPEL business process
    Updated BPEL business process

Part 2: Assembling the BPEL components

You will use the Assembly Diagram to wire processes and various interfaces together so they all work in concert. The project components are placed on the Assembly Diagram Editor canvas and wired together using the wiring tool. Web Services Description Language (WSDL) references are wired to the interfaces.

If the Assembly Diagram Editor is not open, expand the STP project folder in the navigation pane and double-click Assembly Diagram. It should be empty.

Wire the BPEL process to the service

  1. From the expanded STP project folder, drag the CancelRequisition BPEL Process and drop it on the canvas. Notice it has one WSDL Reference (identified by the "1..1" rectangle on the right end) named NotifyPartner with an interface of Notify.
  2. From the expanded STPLibrary folder, drag the Notify interface and drop it on the canvas.
    1. In the Component Creation screen, choose Component with no Implementation Type.
    2. Change the name of Component1 to NotifyService by typing over it.
  3. Highlight the CancelRequisitioncomponent, right-mouse click, and choose Wire to Existing. Click Ctrl+S to save the edits. The Assembly Diagram is shown in Figure 18.
    Figure 18. Assembly Diagram
    Assembly Diagram

Implement the service

  1. Right-mouse click the NotifyService component and choose Generate Implementation > Java.
  2. We recommend to not put things in the default package. Click the New Package button.
  3. Specify a new package name as com.ibm.stp, as shown in Figure 19. Ignore the red X. Click OK.
    Figure 19. Specify a package name
    Specify a package name
  4. Click OK again. NotifyServiceImpl.java, the Java implementation of the service, is displayed in the Java Editor.
  5. Look for “TODO Needs to be implemented” in the NotifyCancellation method. Replace that comment with the line of code highlighted in bold in Listing 1.
    Listing 1. NotifyCancellation implementation code
    public void NotifyCancellation(String emailID, 
     String requisitionNumber, String cancellationReason) {
    		
      System.out.println("*** Sending email notification for requisitionNumber:'" + 
        requisitionNumber+ "' and cancellationReason:'" + cancellationReason + "' to:
        " + emailID);
      }
  6. Click Ctrl+S to save the edits. You can close the Java Editor.

    Tip: In real world applications, the notification service would invoke the email adapter to send emails.
  7. Remember to go to the Assembly Diagram Editor and click Ctrl+S to save the assembly diagram. Close the editor.

Part 3: Build and test the application

Before you can test the application in Integration Designer, make sure there are no build errors in the STP module and STPLibrary artifacts.

Tip: By default, "Build Automatically" is turned on in Integration Designer. This does not make a difference in our tutorial. While building real world applications, it is a good idea to turn "auto build" off and manually build or clean modules when required. The option is found in the main menu under Project.

Go to the Problems view and make sure there are no errors reported.

Unit Test environment

Applications built in Integration Designer are typically tested using the Unit Test environment. An IBM Process Server profile is created as part of Integration Designer installation and it is used to test this STP Process.

  1. Start the Unit Test Server.
  2. Switch to the Servers view and select the server named IBM Process Server v7.5 at localhost, as shown in Figure 20. It is possible your server might have a different name.
    Figure 20. Servers View
    Servers View
  3. In the view toolbar, click the Start the server icon (arrow in a green circle) to start the server. Wait for a few minutes for the server to start. Once the server is started, the status changes from "[Stopped]" to "[Started]".
  4. Look for the following string in the Console view, which indicates the server is ready for service:
    WsServerImpl  A   WSVR0002I: Server server1 open for e-business

Publish the STP application for the Unit Test server

  1. Deploy the STP application to Process Server.
  2. Select Process Server, right-mouse click, and choose Add and Remove to add projects to the server.
  3. Select STPApp in the Available list and click the Add button to move it to the Configured list, as shown in Figure 21. Click Finish.
    Figure 21. Configuring resources on the server
    Configuring resources on the server
  4. STPApp is deployed to the server. The console displays the information that the application is deployed and started. Wait until you see the following message in the Console view:
    ApplicationMg A   WSVR0221I: Application started: STPApp

Test the process

There are a number of ways to test the application. Some common approaches are:

  1. Using the Integration Test Client: This client is an application that is part of Integration Designer and the preferred tool of choice for unit testing applications and components built using Integration Designer.
  2. Using the Business Process Choreographer Explorer: The BPC Explorer is a Web application that is shipped along with IBM Process Server. It is used by both developers and administrators to work with the process instances in the environment.

    Tip: The BPC Explorer should not be used by end users, such as business users. The audience for the BPC Explorer is the IT team. End users should interact with BPM applications via Business Space or custom-built user interfaces.

  3. Using Web Services Explorer or external applications like SOAPUI by having the BPEL process exposed via a Web Service Export:
    1. The CancelRequisition BPEL process needs to be exposed so that other applications can invoke this process. The client for this BPEL process is a process application created using IBM Process Designer or a JEE application. Depending on the caller, the BPEL process is exposed via one or more of the supported exports. The traditional approaches are having an SCA Export and a Web Service Export.
    2. Once a Web Service Export is available, you can test the process using the inbuilt Web Service explorer, or using third party tools such as SOAPUI.

For this tutorial, we will use the BPC Explorer approach.

  1. Bring up the BPC Explorer Web application.
  2. Select IBM Process Server, right-mouse click, and choose Launch > Business Process Choreographer Explorer.
  3. Under Process Templates, click Currently Valid to see the list of currently valid process templates, as shown in Figure 22.
    Figure 22. Process Templates
    Process Templates
  4. Start an instance of the CancelRequisition process. Select the check box to the left of CancelRequisition. Click on Start Instance.
  5. Enter the inputs for the process (see Figure 23). Specify the first name as John, the last name as Doe, and requisition number as 123. Click on Submit.
    Figure 23. Entering the process input message
    Entering the process input message
  6. The BPEL process completes its activities and returns the result, as shown in Figure 24.
    Figure 24. View the result
    View the result
    Notice that the result is empty. It is left as an activity for the reader to return an appropriate result.
  7. Ensure that the Console view shows the output created by NotifyServiceImpl:
    SystemOut O *** Sending email notification for requisitionNumber:'123' and 
    cancellationReason:'Changed my mind' to: 'ashoki@us.ibm.com'

    Note: As a quick way of testing the process, you would add an Assign activity in the BPEL flow before the call to Notify Admin and hardcode the values as shown in Figure 25.

    Figure 25. The Assign activity
    The Assign activity
  8. Ensure that the process instance has completed all its activities by checking its status in the BPC Explorer. You can view the status of the process by clicking on Started By Me under Process Instances.

You have now completed the tutorial by creating a BPEL microflow in Integration Designer, assembling the application components, and then testing the process flow.


Conclusion

In this straight through processing scenario, you did all the work using Integration Designer. You created a project library to store all the resources. You then created the interfaces, stored them in the library, and made sure that it was added as a dependency to the module that was created next. You created a simple BPEL process flow, assembled all the components together, and finally deployed and tested the process application. No matter how simple or complicated the BPEL process, the entire microflow process runs as a single transaction. The tutorial demonstrated the versatility of Integration Designer and some of the nuances of a BPEL process, such as interfaces and partners.

In the final installment of the orchestration scenarios, we will describe a variation of this scenario by adding an exception that is to be handled by humans.

Acknowledgments

The authors would like to thank Srikanth Ganesan for his review of the tutorial.

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Business process management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management, WebSphere
ArticleID=768979
ArticleTitle=IBM BPM V7.5 orchestration scenarios, Part 2: Straight through processing using IBM Integration Designer
publish-date=11022011