Skip to main content

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

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

All information submitted is secure.

  • Close [x]

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.

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

All information submitted is secure.

  • Close [x]

developerWorks Community:

  • Close [x]

Build and deploy a business process model using WebSphere Business Process Modeler Advanced and Lotus Forms, Part 2: Implement and test the BPEL process using WebSphere Integration Developer

Attila Kiss (attila_kiss_bme@yahoo.com), Student, Budapest University of Technology and Economics
Attila Kiss
Attila Kiss attends Budapest University of Technology and Economics and will graduate as a Computer Science Engineer in 2008. He specializes in IT infrastructure management. He has been working with WebSphere products with special focus on business modeling.
Viktor Muller (viktormuller@gmail.com), Student, Budapest University of Technology and Economics
Viktor Muller Photo
Viktor Müller attends Budapest University of Technology and Economics and graduates as a Computer Science Engineer in 2009. He specializes in information system development. He has worked with WebSphere products with a special focus on BPEL development.

Summary:  Learn how to use IBM® WebSphere® Integration Developer to implement and customize a Business Process Execution Language (BPEL) process and then test it in WebSphere Process Server. Part 2 of this tutorial series shows you the steps for generating the Web interface, assembling the components, and testing the solution.

View more content in this series

Date:  15 Apr 2009
Level:  Intermediate PDF:  A4 and Letter (3098 KB | 55 pages)Get Adobe® Reader®

Activity:  13364 views
Comments:  

Assembling the solution

The assembly editor in Integration Developer lets you build applications by assembling Service Component Architecture (SCA) components. In this tutorial, the invocation task will call the process, while the process will invoke two external services implemented in HRProject_impl. In order to use services implemented outside the project, imports and exports are created.

Assembling HRProject_impl module

First you will update the assembly diagram of the HRProject_impl module that contains the implementation of the services used by HRProcess. You will create components with no implementation type and exports with SCA Binding for the services RegisterTheNewEmployeeToBackEnd and SendMailCanonical.

  1. Open the assembly diagram of the HRProject_impl module.
  2. Delete all components except from the import and the component named RegisterTheNewEmployeeToBackEnd.

    Figure 59. Deleting components in the assembly diagram
    Deleting components in the assembly diagram

  3. Generate an SCA binding for the RegisterTheNewEmployeeToBackEnd export.

    Figure 60. Generating an SCA binding for the RegisterTheNewEmployeeToBackEnd export
    Generating an SCA binding for RegisterTheNewEmployeeToBackEnd

  4. Drag and drop SendMailCanonical interface to the canvas.
  5. Select Component with no Implementation Type.

    Figure 61. The Component with no Implementation type
    Component with no Implementation type

  6. Rename the component to SendMailCanonical.
  7. Right-click the SendMailCanonical component.
  8. Select Generate Export > SCA Binding.

    Figure 62. Generating an SCA binding for the SendMailCanonical export
    Generating an SCA binding for SendMailCanonical



    Figure 63. The updated assembly diagram
    The                                 updated assembly diagram


Implementing the services

In this section you implement the two services for which you just created the SCA components. Both of them will print the request data to the standard out log, but while SendMailCanonical accesses the fields of the request one by one, RegisterTheNewEmployeeToBackEnd uses a built-in functionality of the Process Server that enables data serialization to XML.

  1. Right click SendMailCanonical component.
  2. Select Generate Implementation > Java.

    Figure 64. Implementing the services
    Implementing the services

  3. Select processes.hrprocess.
  4. Complete the body of SendMail method with the following code.
    String to = request.getString(“message/to”);
    String subject = request.getString(“message/subject”);
    String body = request.getString(“message/body”);
    

    System.out.println(“To: “ + to);
    System.out.println(“Subject: “ + subject);
    System.out.println(“Body: “ + body);
    

    Note: You can access the fields of the request using XPath expressions. This method can be also used to access fields of process variables from a snippet. Both SCA components with Java implementation (by default) and snippets use the Service Data Object (SDO) data model that allows data manipulation in a simple and flexible way. SDOs are used extensively in Process Server. See Resources for more details on SDOs.

  5. Right click RegisterTheNewEmployeeToBackEnd component.
  6. Select Generate Implementation > Java.
  7. Select processes.hrprocess.
  8. Complete the body of InputCriterion method with the following code.
{
// print BO to log             
      com.ibm.websphere.bo.BOXMLSerializer srv = (com.ibm.websphere.bo.BOXMLSerializer) 
              new com.ibm.websphere.sca.ServiceManager()
                
                    .locateService(“com/ibm/websphere/bo/BOXMLSerializer”);
                     common.sdo.Type type = input2.getType();
                
                    try {
                srv.writeDataObject(input2, type.getURI(), type.getName(),               
                    java.lang.System.out);
                
                    } catch (java.io.IOException ex) {
                
                    ex.printStackTrace();
                
                    }                 
            }
                


Assembling the HRProject module

Now you will edit the Assembly Diagram of the HRProjectmodule. You will update the references of the process and bind the service imports to the service exports of the HRProject_impl module.

  1. Open HRProject.
  2. Double-click Assembly Diagram.

    Figure 65. Opening the assembly diagram
    Opening                                 the assembly diagram

  3. Select all components.
  4. Delete them by pressing the Delete button.
  5. Drag and drop the HRProcess from the Business Integration view to the canvas.
  6. Navigate to Properties => Details.
  7. Delete LoadApplicationToRepositoryPartner, Notification2Partner, and PreCheckPartner from References.

    Figure 66. Deleting references
    Deleting references

    Examine the process implementation, and observe that the Reference Partners corresponding to the deleted References are still there.

  8. Right-click the HRProcess component.
  9. Select Synchronize Interfaces and References => to Implementation.

    Figure 67. Synchronizing interfaces and references
    Synchronizing interfaces and references

    The Reference Partners are now deleted.

  10. Drag and drop the SendMailCanonical interface from HRProject_lib to the Assembly Diagram.
  11. Right-click the SendMailCanonicalImport1 component.
  12. Select Generate Binding > SCA Binding.
  13. Repeat steps 10-12 for the RegisterTheNewEmployeeToBackEnd interface.
  14. Right-click the HRProcess component.
  15. Select Wire to Existing.

    Figure 68. Connecting references and interfaces
    Connecting references and interfaces

    This connects the references of the HRProcess component to the interfaces of the corresponding imports. Reference and interface matching is based on the interfaces associated with them.

    Using SCA bindings is the easiest and most efficient way to consume services defined outside the module, but there are several other binding types that can be used including Web services, HTTP, and native WebSphere MQ.

    Next you will bind the imports in the HRProject module to the exports in the HRProject_impl module.

  16. Select SendMailCanonicalImport1 import.
  17. Navigate to Properties > Binding.
  18. Click Browse.
  19. Select SendMailCanonicalExport.
  20. Click OK.
  21. Connect RegisterTheNewEmployeeToBackEndImport1 to RegisterTheNewEmployeeToBackEndExport the same way.

    Figure 69. Binding imports to exports
    inding                                 imports to exports

8 of 14 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management, WebSphere
ArticleID=432422
TutorialTitle=Build and deploy a business process model using WebSphere Business Process Modeler Advanced and Lotus Forms, Part 2: Implement and test the BPEL process using WebSphere Integration Developer
publish-date=04152009
author1-email=attila_kiss_bme@yahoo.com
author1-email-cc=crothemi@us.ibm.com
author2-email=viktormuller@gmail.com
author2-email-cc=crothemi@us.ibm.com