Skip to main content

Integration Cookbook for WebSphere Business Integration Modeler and WebSphere Studio Application Developer Integration Edition

Thomas Kasemir (kasemir@de.ibm.com), Team Lead Lab-Services, WebSphere Solution Center, IBM Germany
Photo of Thomas Kasemir
Thomas Kasemir is a software engineer at the IBM Lab in Boeblingen, Germany. He is the team-lead of the Lab-Services team with the focus on Process Choreographer and Web Services. You can reach Thomas at kasemir@de.ibm.com.

Summary:  This "cookbook" describes an integration scenario using WebSphere Business Integration Modeler 5.1 and IBM WebSphere Studio Application Developer Integration Edition 5.1. You can use this cookbook to learn and demonstrate the integration capabilities of these products.

Date:  09 Mar 2005
Level:  Intermediate
Activity:  355 views
Comments:  

Introduction

The integration of IBM® WebSphere® Business Integration Modeler 5.1 (hereafter called Modeler) and IBM WebSphere Studio Application Developer Integration Edition 5.1 (hereafter called Application Developer) is very important for every customer using IBM's Business Integration software. Modeler enables the business analyst to design, simulate, optimize and document the processes of the company. Application Developer is the IT department tool for implementing and maintaining these processes. The integration of Modeler and Application Developer is key to the integration of business analysis and IT systems.

Our sample will be a real-life process from a bank customer that implements a funds order process. The process checks the validity of the order details and decides whether a manager approval is needed. Depending on the results of these verifications and approvals, the process forwards the order to an error queue, creates a work item for the manager approval, sends a rejection mail to the customer, or -- if everything is OK -- executes the order.

This cookbook contains three chapters:

  • Chapter 1: Model the process in Modeler -- creates the sample process with Modeler and adds data objects, decision conditions and resources.
  • Chapter 2: Finalize the process implementation in Application Developer -- explains the export procedure to Application Developer in BPEL format.
  • Chapter 3: Deploy and test the process -- shows the technical implementation of the process including the reuse of existing services and the creation of new service implementations.

You should have basic skills in the usage of these two solutions and with the Eclipse development environment.


Supporting material

In the Download section of this cookbook you'll find supporting material and the following files which you need to execute the steps in this exercise.

WTC04 -- WBI Modeler and BPC.ppt -- The presentation, "Integrating IBM WBI Modeler 5.1 and WebSphere Studio Application Developer Integration Edition 5.1," gives you a Modeler 5.1 overview, describes the external integration including the BPEL4WS export in more detail, and gives you a summary of the first best practices.

WorkspaceA.zip, WorkspaceB.zip, WorkspaceC.zip -- While executing the steps in this cookbook, you'll find checkpoints in chapter 1 and 2. For each checkpoint, there is a workspace which you can use to skip a chapter or continue with a clean environment. You can also use the last checkpoint to show the complete integration scenario.

FundsOrderData.xsd, FundsOrderEAR.ear -- These files contain the XML schema definition for the funds order data object and the EJB project with the implementation for one of the services from the sample process.


Chapter 1: Model the process in Modeler

Part 1: Prepare the process environment in Modeler

  1. Start Modeler with an empty workspace. If you're using the Modeler plug-in, start Application Developer and open the Business Modeling perspective. If you want to skip the process modeling, you can open the workspace WorkspaceA and continue with chapter 2. If you want to see the complete sample first, start with WorkspaceC and continue with chapter 3. The Download section describes how to import workspaces (see How-to_import_workspaces.txt in the files.zip).
  2. Switch to the 4-pane layout, click Apply 4-pane layout on the tool bar.
  3. Switch to BPEL mode. This mode disables all elements in the Modeler not compatible with BPEL and validates the model for the BPEL export.
  4. Right-click in the Project Tree, create a new Business Modeling Project.
  5. Name the project FundsOrderModel, the process catalog bankProcesses, and the process FundsOrderProcess.
  6. Right-click on Business items and rename the folder bankDO. Then right-click on bankDO and create a new Business Item.
  7. Name the Business Item FundsOrderData and click Finish.
  8. Now add the attributes as shown in Figure 1 and save the Business Item.
  9. Create an organization for a later staff interaction. Right-click on Organization in the Project Tree and create a new Organization Unit. Name the new organization Manager and save it.

    In this sample, no more data definitions are needed. In a real-life environment, more resources, business items, and organizations will generally need to be defined.


Figure 1: Details of business item FundsOrderData
Figure 1: Details of business item FundsOrderData

Part 2: Model the process

  1. Now start with the process modeling. Close the created business item and resource and open the FundsOrderProcess model from the Project Tree.
  2. Delete the start and end node in the editor pane, because input and output criteria (data structures) will be defined explicitly for the process.
  3. First add all the Local Task, Decision, Merge, and Map elements. Rename them as shown in Figures 3 to 5, but don't connect the elements for now. Ignore the warnings and errors, they will be resolved later.
  4. Add the input and output criteria for the local tasks. Select the first task, Verify Funds Order and go the Input tab in the Attributes View.
  5. Add a new input criteria called VerfiyRequest. Set the Associated data to the complex type FundsOrderData.
  6. Repeat steps 4 and 5 and set the input and output criteria for all the tasks as shown in Table 1. Use the complex type FundsOrderData for the input criteria of all tasks and the simple type Boolean for the output criteria of all tasks.

Table 1: Input and output criteria for the local tasks

Local task Input criteria (type) Output criteria (type)
Verify Funds Order VerifyRequestVerifyResponse
Manager ApprovalApprovalRequestApprovalResponse
Forward to error queueForwardRequestForwardResponse
Send Rejection MailRejectionRequestRejectionResponse
Execute OrderExecuteRequestExecuteResponse
  1. Connect the elements as shown in Figures 3 to 5. When connecting one of the Local Tasks to another element, make sure that the existing input and output connections are used as shown in Figure 2. Only create new input and output connections for the Map, Decision and Merge elements.
    Figure 2: Use the existing input and output connections
    Figure 2: Use the existing input and output connections
  2. Finally, save the process model.

Figure 3: First part of the complete process model
Figure 3: First part of the complete process model

Figure 4: Second part of the complete process model
Figure 4: Second part of the complete process model

Figure 5: Final part of the complete process model
Figure 5: Final part of the complete process model

Part 3: Add decision conditions to the process model

  1. Change the operation mode to Intermediate. This is needed to edit the condition expressions for the decision elements.
  2. Add conditions for the decision elements. Click on the first decision element Order valid?.
  3. Go to the tab Output branches in the Attributes View and select the Yes output branch.
  4. Scroll down in the Attributes View until you reach the Decision Branch Condition section.
  5. Click Edit expression and enter the condition as shown in Figure 6.
    Figure 6: Decision condition for decision element Order valid?
    Figure 6: Decision condition for decision element Order valid?
  6. Repeat these steps for the other decision elements and apply the conditions shown in Table 2.

Table 2: Input and output criteria for the local tasks

Decision element Condition
Order Valid?'Processes.FundsOrderProcess.Order valid?.Input' is equal to true
Approval?'Processes.FundsOrderProcess.Approval?.Input:2.amount' is greater than 10.0
Approved?'Processes.FundsOrderProcess.Approved?.Input' is equal to true
  1. Change the operation mode back to Basic and save the process.

Part 4: Add a resource definition to the process model

  1. Add the resource definition for the task Manager approval (the human being needed to fulfill this task). Click on the Local Task Manager approval.
  2. Go to the Resources tab in the Attributes View and scroll down to the section Individual resource requirements.
  3. Click Add and rename the resource requirement to ManagerGroup.
  4. Set the Individual resource to Staff.
  5. Enter the Resource Selection Criteria as shown in Figure 7.
  6. Save the process model.

Figure 7: Resource Selection Criteria for the Local Task Manager approval
Figure 7: Resource Selection Criteria for the Local Task Manager approval

Chapter 2: Finalize the process implementation in Application Developer

Part 5: Export the process

  1. Save all pending changes and select Export from the File menu.
  2. Select WebSphere Business Integration Modeler Export from the list and click Next. If you want to skip the process import and the integration of an existing service implementation, you can open the workspace WorkspaceB and continue with chapter 2, part 10. The Download section explains how to import these workspaces (see How-to_import_workspaces.txt in the files.zip).
  3. Select the BPEL export from the list and click Next.
  4. Select a target directory and the project FundsOrderModel to export the entire project. Click Next.
  5. Choose to export the process as a Long-running process with receive/reply activities and click Finish. There should be no errors or warnings.

    When you're using the Modeler plug-in for the Application Developer, you can export the model directly into a new Service Project in the same workspace. If your workspace is located in C:\MyWorkspace\ and your new Service Project is called FundsOrderService, you can export your model to C:\MyWorkspace\FundsOrderService. Then switch to the Business Integration perspective and refresh the view.

  6. Close Modeler and start Application Developer with a new workspace. When you're using the Modeler plug-in, switch to the Business Integration perspective. Right-click in the Project Tree and create a new Service Project.
  7. Name the project FundsOrderService and click Finish.
  8. Right-click on the FundsOrderService project in the Tree and select Import.
  9. Select File System from the list and click Next. Choose the directory which you used before for the Modeler export.
  10. Select all the directories and check that the Into folder points to your FundsOrderService project. Click Finish.

Part 6: Explore the imported process

  1. There should be no errors or warnings after the import. Expand the Project Tree and explore the project structure.
  2. Delete RootOrganizationModel.xsd and RootResourceModel.xsd since these files and packages are not used.
  3. Open the process FundsOrderProcess and explore the BPEL process.
  4. The export function created Partner Links and Service interfaces for all tasks in the process. The activities are associated with operations and input/output variables have been created. Also Assign activities have been added where needed. The conditions from the decision elements have been mapped to conditions on the links after the activities: Order valid?, Approval?, and Approved?.
  5. The resource settings for the task Manager approval have been mapped to a Staff activity and the verb for the Potential Owner is set to the expression Group Members as shown in Figure 8. For later testing, change the Group Name to Manager and make sure that there is a group called Manager with at least one user assigned to it in your local user registry.
    Figure 8: Staff settings for Staff activity Manager approval
    Figure 8: Staff settings for Staff activity Manager approval
  6. In this sample the implementations for the Map activities are not needed. Only one change has to be done. Locate the Approval? activity in the process as shown in Figure 9.
    Figure 9: The Approval? activity and outgoing links
    Figure 9: The Approval? activity and outgoing links
  7. Modify the conditions on these links, because they are using the output of Map activities that are not implemented. Select the link between the Approval? activity and the Manager approval activity.
  8. Go to the condition tab, delete the existing expression and enter the following expression using the Visual Expression editor.

    InputCriteriaVariable.InputPart.amount > 10

  9. Select the link between the Approval? activity and the Merge Input Criteria:2 activity.
  10. Go to the condition tab, delete the existing expression and choose Otherwise for this condition.

Part 7: Import an existing EJB project

  1. Import an existing EJB project into your workspace and use an existing EJB service in your business process. Select Import from the File menu and select EAR file.
  2. Navigate to the file FundsOrderEAR.ear which you downloaded with this cookbook and click Finish.
  3. Switch to the J2EE Hierarchy and inspect the new EJB project. It contains a session bean called VerifyOrderPT with the method verifyFundsOrder in the remote interface. This method will be used as a service in our business process.
  4. Create a service interface for this EJB in our service project. Switch to the Services perspective, right-click on the FundsOrderService project, select New and then Service built from .
  5. Choose to create a service for an existing session bean. Select EJB and click Next.
  6. Select the VerifyOrderPT bean and then the method verifyFundsOrder. Click Next.
  7. Change the package name to bankProcesses.ejb and accept all other default values. Click Finish and accept the change to Java build path.
  8. Review the generated WSDL files and check that the operations and messages match with the EJB method. Please notice that the input message contains the complex type FundsOrderData.

Part 8: Use an existing service in the process

  1. Link the activity Verify Funds Order in our business process with this service interface. Open FundsOrderProcess and select the Partner Link VerifyFundsOrderPartner on the right side as shown in Figure 10.
    Figure 10: Select the Partner Link VerifyFundsOrderPartner
    Figure 10: Select the Partner Link VerifyFundsOrderPartner
  2. Go to the Implementation tab and click Edit to change the settings for this Partner Link as shown in Figure 11.
    Figure 11: Edit the Partner Link Type VerifyFundsOrderPartnerLink
    Figure 11: Edit the Partner Link Type VerifyFundsOrderPartnerLink
  3. Change the Port Type File to point to the file VerifyOrderPT.wsdl in the package bankProcesses.ejb which you generated in the previous part.
  4. In the BPEL editor, select the Verify Funds Order activity and go to the Implementation tab.
  5. Select the operation verifyFundsOrder from the list.
  6. Create new variables for the request and response messages called VerifyFundsOrderRequest and VerifyFundsOrderResponse.
  7. Delete the variable VerifyFundsOrderOutputCriteriaVariable and save the process. The remaining errors will be resolved in the next steps.

Part 9: Add a transformer service to your process

  1. Map the process input message to the input message for the first activity Verify Funds Order. Insert a Transform activity before the first Invoke activity.
  2. In the Implementation tab, assign the variable InputCriteriaVariable as input and the variable VerifyFundsOrderRequest as output.
  3. Click New to create a new transformer service.
  4. Change the Partner Link name to TransformPartner and the namespace to http://FundsOrderProcess.bankProcesses. Click OK.
  5. Map all parts from the input message to the corresponding part of the output message and save the transformer service.
  6. Adapt the conditions after the Verify Funds Order activity to work with the new output variable from the activity. Select the link between the Order valid? activity and the Map1 Java snippet.
  7. Change the condition to VerifyFundsOrderResponse.result == true using the Visual Expression editor.
  8. Select the link between the Order valid? activity and the Map2 Java snippet and set the condition to Otherwise.
  9. Save the process.

Part 10: Create a new service implementation

  1. Use the wizards of the Application Developer to create new EJBs implementing the services defined in the interfaces generated by the Modeler. If you want to skip the creation of service implementations, you can open the workspace, WorkspaceC, and continue with chapter 3.

    In the Services view, expand FundsOderProcessInterface.wsdl and the Port Types.

  2. Right-click on the first Port Type ExecuteOrderPT and start the wizard Build from Service.
  3. Choose the create an EJB Service Skeleton and click Next twice to accept all default settings.
  4. Select the WSDL file FundsOrderProcessInterface.wsdl to include the interface description for your new service and select the Port type ExecuteOrderPT. Accept all other defaults and click Next.
  5. Select the FundsOrderEJB project and click Finish.
  6. Go back to the J2EE view and expand the EJB Modules folder to see the created EJB. Open the ExecuteOrderPTBean.
  7. Look for the method sendExecuteOrder_InputCriteria and add the code statement shown in Figure 12. Save and close the Java editor.
    Figure 12: Add user code to the generated EJB skeleton
    Figure 12: Add user code to the generated EJB skeleton
  8. Repeat step 7 for the Port Types ForwardtoerrorqueuePT and SendRejectionMailPT. The methods of these EJBs should return the boolean value false. Save your changes.
  9. After creating all three EJBs, generate the deploy code for the EJBs. In the J2EE view, right-click on the FundsOrderEJB project and select Deployment and RMIC Code....
  10. In the next screen, click Select All and then Finish.

Chapter 3: Deploy and test the process

Part 11: Generate deploy code and create a test server

  1. Create the deployment code for your business process. Go to the Services view, right-click on FundsOrderProcess, and select Generate Deploy Code.
  2. As the process is long-running and uses a request/response interface, only a JMS binding can be generated. In the Referenced Partners section, set the service endpoints for the Partners in the process. Select the xxxEJBService.wsdl for each Partner as shown in Figure 13 and click Finish.
    Figure 13: Set the Referenced Partners for the Partner Links of your process
    Figure 13: Set the Referenced Partners for the Partner Links of your process
  3. In the Process Settings section accept the default value to use a Staff Plugin Provider configuration which will be created in later. Please make sure that a group with the name Manager exists on your system and that at least one user is member of this group.

    If you don't want to configure a Staff Plugin Provider and enable security for your test server, select bpe/staff/everybodyconfiguration in the Process Settings as Staff Plugin Provider. Now every work item can be claimed by any unauthenticated user and you can skip part 12. With this configuration, you don't need to have a Manager group either.

  4. Create a server and server configuration to test our business process. At the bottom of the screen go to the Servers view, right-click in the empty list and create a new server configuration.
  5. Enter the name TestServer and check that Integration Test Environment is selected. Click Finish.
  6. Right-click on the new server and select Add and remove projects. Select all projects and click Finish.
  7. Right-click on the server again and select Publish.
  8. Right-click on the server TestServer and select Create tables and data sources to create the table for the long-running process.

Part 12: Prepare the Staff-Plugin Provider and configure security

  1. Double-click on the server TestServer to open the server configuration. Go to the Staff tab and scroll down the section Server Settings.
  2. Select the User Registry Staff Plugin Provider in the first list and click Add for the second list
  3. Enter User Registry Staff Plugin Provider Configuration as name and bpe/staff/userregistryconfiguration as the JNDI name.
  4. For the XSL Transformation File, select in your Application Developer install directory /runtimes/ee_v51/ProcessChoreographer/Staff/UserRegistryTransformation.xsl.
  5. Go to the Security tab and enable security for this server. Enter the credentials of the admin user of your machine. Do not enable Java 2 security.
  6. Save and close the configuration.
  7. Set the user for the BPESystemAdministrator role. Right-click on the server TestServer and select Edit BPEContainer Deployment Descriptor.
  8. Go to the Security tab and select the role BPESystemAdministrator. Check that the listed user is a system administrator of your local machine and change this setting if needed.
  9. Next select JMSAPIUser and scroll down to the Run As section and check that the listed user is a system administrator. Save and close the Deployment Descriptor.

Part 13: Test the process in the Business Process Web Client

  1. Start the server TestServer and use the Business Process Web Client to test the process. After the server is started, right-click on TestServer start the Business Process Web Client.
  2. Logon with any valid user ID and select My Templates from the menu on the left side. Select the process template and click Start Instance.
  3. In the first test run, enter the input parameters shown in Figure 14 and click Start Instance.
    Figure 14: Input parameters for the first test run
    Figure 14: Input parameters for the first test run
  4. With these settings the process will finish immediately, because no manager approval is needed. Check the system log for the status messages of our service implementations as shown in Figure 15.
    Figure 15: Status messages after the first test run
    Figure 15: Status messages after the first test run
  5. Now start a new process instance and change the parameter amount to 20. This time a member of the group Manager has to approve the order.
  6. After starting the process the system log shows that only the first activity has been executed as shown in Figure 16
    Figure 16: Status message after starting second test run
    Figure 16: Status message after starting second test run
  7. Logout from the Web Client and login as a user of the group Manager. In the My ToDo's list you can see that a work item is waiting for you as shown in Figure 17.
    Figure 17: Pending work item in second test run
    Figure 17: Pending work item in second test run
  8. Claim this work item and enter true or false for the approval of this order. Click Complete to finish this work item. If you have chosen to reject this order, you'll see in system log that the activity Send Rejection Mail has been processed as shown in Figure 18.
    Figure 18: Status message after order is rejected in second test run
    Figure 18: Status message after order is rejected in second test run

You're done. From process modeling in Modeler to implementation in Application Developer, you now have a running integration scenario.


Conclusion

With this integration cookbook, you have developed an integration scenario using WebSphere Business Integration Modeler 5.1 and WebSphere Studio Application Developer Integration Edition 5.1. In the three chapters of this exercise, you've accomplished a complete walk-through, starting with a process model in Modeler and ending in Application Developer with a running application.

You can now demonstrate the running solution or go through the exercise again and show the integration process to other people. You can also extend the sample with processes and requirements from your own business environment.



Download

NameSizeDownload method
files.zip2955 KBFTP|HTTP

Information about download methods


Resources

About the author

Photo of Thomas Kasemir

Thomas Kasemir is a software engineer at the IBM Lab in Boeblingen, Germany. He is the team-lead of the Lab-Services team with the focus on Process Choreographer and Web Services. You can reach Thomas at kasemir@de.ibm.com.

Comments



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
ArticleID=49019
ArticleTitle=Integration Cookbook for WebSphere Business Integration Modeler and WebSphere Studio Application Developer Integration Edition
publish-date=03092005
author1-email=kasemir@de.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