Skip Headers
Oracle® BPEL Process Manager Order Booking Tutorial
10g Release 2 (10.1.2)
B15813-02
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

4 Adding Parallel Flow

This chapter of the tutorial describes how to build parallel flow logic to call another asynchronous service for receiving a supplier price.

This chapter contains the following topics:

4.1 Introduction

This phase of the tutorial adds to the OrderBooking process you designed in Chapter 3, "Invoking an Asynchronous Service". Ensure that you have successfully completed that phase before performing this one. In this phase of the tutorial, you build parallel flow logic to call the asynchronous BPEL process to receive supplier prices from two services for a client order. You perform the following key tasks:

4.2 Adding Parallel Flow to the Order Booking Tutorial

This section contains the following tasks:

4.2.1 Starting and Testing Your Services

The Select Manufacturing service was automatically started when you started the Rapid Distributors service in "Starting and Testing Your Services". If the Select Manufacturing service is not currently running, see that section for instructions on starting it.

  1. Access the Select Manufacturing user application using Internet Explorer or Mozilla Firefox to see if it is deployed:

    http://localhost:9700/SelectManufacturingUI
    
    

    The Order List to Review and Quote Price window appears.

4.2.2 Creating a Select Manufacturing Partner Link


Summary:

You now create the partner link for the Select Manufacturing service.

  1. Return to JDeveloper BPEL Designer.

  2. Ensure that Process Activities is selected in the drop-down list of the Component Palette section.

  3. Drag and drop a PartnerLink activity onto the left side of the designer window (below the Partner Links header and above the client partner link).

    Description of obph3dnd.gif follows
    Description of the illustration obph3dnd.gif

  4. Enter the following values to create a partner link for the Select Manufacturing service:


    Note:

    For the WSDL File field below, click the flashlight (the second icon from the left named WSIL Browser) to access the WSDL Chooser window for automatically selecting the Select Manufacturing service deployed in "Starting and Testing Your Services".

    Field Value
    Name SelectManufacturing
    WSDL File Access this URL by clicking the WSIL Browser flashlight icon and expanding and selecting LocalBPELServer > processes > default > SelectManufacturing.

    http://localhost:9700/orabpel/default/SelectManufacturing/SelectManufacturing?wsdl

    See Also: "Setting the Hostname in Your JDeveloper BPEL Designer Web Browser Preferences" if you receive a parsing error when attempting to add a WSDL file in the WSDL Chooser window.

    Partner Link Type SelectManufacturing
    My Role SelectManufacturingRequester
    Partner Role SelectManufacturingProvider

  5. Click OK.

  6. Select Save from the File main menu.

4.2.3 Creating a Flow Activity


Summary:

You now create a Flow activity into which you place Invoke and Receive activities for both the Rapid Distributors and Select Manufacturing suppliers. A Flow activity is required to invoke the two suppliers in parallel. The order's line items are passed to the two suppliers for their price quotes.

  1. Drag and drop a Flow activity from the Component Palette section to below the GetCreditRating Scope activity.

    Description of obph3dnd1.gif follows
    Description of the illustration obph3dnd1.gif

  2. Double-click the diamond to display the Flow window.

  3. Enter GetPriceQuote in the Name field.

  4. Click OK.

  5. Drag and drop the following activities that you created in Chapter 3, "Invoking an Asynchronous Service" into the right panel of the GetPriceQuote Flow activity. Drag each activity one at a time and place them in the following order.

    • assignRDIn

    • invokeRD

    • receiveRD

    Description of obph3dnd2.gif follows
    Description of the illustration obph3dnd2.gif

  6. Select Save from the File main menu.

4.2.4 Creating Invoke and Receive Activities

  1. Drag and drop an Invoke activity from the Component Palette section into the left panel of the GetPriceQuote Flow activity.

    Description of obph3dnd3.gif follows
    Description of the illustration obph3dnd3.gif

  2. Double-click the Invoke icon to display the Invoke window.

  3. Enter the following details:

    Field Value
    Name invokeSM
    Partner Link SelectManufacturing

    The Operation (initiate) field is automatically filled in.

  4. Click the first icon to the right of the Input Variable field. This is the automatic variable creation icon.

    Description of autocreate.gif follows
    Description of the illustration autocreate.gif

  5. Click OK on the Create Variable window that appears.

    A variable named invokeSM_initiate_InputVariable is automatically created in the Input Variable field. This variable is automatically assigned a message type of SelectManufacturingRequestMessage.

  6. Click OK.

  7. Drag and drop a Receive activity below the invokeSM Invoke activity you just created.

    Description of obph3dnd4.gif follows
    Description of the illustration obph3dnd4.gif

  8. Double-click the Receive icon to display the Receive window.

  9. Enter the following details:

    Field Value
    Name receiveSM
    Partner Link SelectManufacturing

    The Operation (onResult) field is automatically filled in.

  10. Click the first icon to the right of the Variable field. This is the automatic variable creation icon.

  11. Click OK on the Create Variable window that appears.

    A variable named receiveSM_onResult_InputVariable is automatically created in the Variable field. This variable is automatically assigned a message type of SelectManufacturingResponseMessage.

  12. Click OK.

  13. Select Save from the File main menu.

4.2.5 Creating an Assign Activity


Summary:

You now create an Assign activity that passes the customer's order line items to the Select Manufacturing supplier for their price quote.

  1. Drag and drop an Assign activity from the Component Palette section into the left panel of the GetPriceQuote Flow activity and above the invokeSM Invoke activity.

    Description of obph3dnd5.gif follows
    Description of the illustration obph3dnd5.gif

  2. Double-click the assign icon to display the Assign window.

  3. Click the General tab.

  4. Enter assignSMIn in the Name field.

  5. Click Apply.

  6. Click the Copy Rules tab.

  7. Click Create to display the Create Copy Rule window.

  8. Enter the following details:

    Field Value
    From
    • Type
    Variable
    • Variables
    Expand and select Variables > inputVariable > payload > ns1:PurchaseOrder > ns1:OrderItems

    Note: The namespace number values (for example, ns1, ns2) can vary. Use the namespace values that automatically appear.

    To
    • Type
    Variable
    • Variables
    Expand and select Variables > invokeSM_initiate_InputVariable > payload > ns1:OrderItems

  9. Click OK to close the Create Copy Rule window and the Assign window.

    The designer window looks as follows:

    Description of obph3flowex.gif follows
    Description of the illustration obph3flowex.gif

  10. Click the - sign to close the GetPriceQuote Flow activity. In this phase of the tutorial, you do not create an additional Assign activity to explicitly copy the received data of invokeSM_initiate_InputVariable into another variable.

  11. Select Save from the File main menu.

    When complete, the designer window looks as follows:

    Description of obph3.gif follows
    Description of the illustration obph3.gif

4.2.6 Validating, Compiling, and Deploying the Order Booking Process

  1. Go to the Applications Navigator section.

  2. Right-click OrderBooking.

  3. Select Deploy > LocalBPELServer > Deploy to default domain.

  4. Enter the domain password of bpel when prompted.

  5. Increment the version number again of the project when prompted and click OK (for example, enter 1.2).

    This compiles the BPEL process. Review the bottom of the window for any errors. If there are no errors, deployment was successful. If deployment was unsuccessful, see Step 5.

4.2.7 Running the Order Booking Process

  1. Log into Oracle BPEL Console by selecting Start > All Programs > Oracle - Oracle_Home > Oracle BPEL Process Manager 10.1.2 > BPEL Console (or refresh the page if it is already open).

    The Dashboard tab of Oracle BPEL Console appears.

  2. Click the OrderBooking version you increased in Step 5 in the Deployed BPEL Processes list.

  3. Enter details in all fields of the HTML Form. You can also use a text editor to copy and paste these details from the contents of the OrderBookingPO_1.xml file:


    Note:

    Do not copy and paste from Internet Explorer or Mozilla Firefox. You must use a text editor to perform this task.

    1. Select XML Source from the Initiating a test instance list.

    2. Copy and paste the contents of OrderBookingPO_1.xml into the field that appears.

  4. Click Post XML Message.

    The BPEL Processes tab displays a message similar to the following:

    Test Instance Initiated
    
    
  5. Click the Instances tab at the top.

  6. Verify that the OrderBooking, CreditRatingService, TaskManager, SelectManufacturing, and RapidDistributors instances were created. All should appear in the Instance list. The Last Modified list displays the times at which they were created. The CreditRatingService and RapidDistributors instances complete relatively faster, since they are automated services. SelectManufacturing is running and awaiting user input to complete. This is defined in the TaskManager service, which is also awaiting completion.

  7. Click the OrderBooking instance you increased in Step 5 in the Instance list.

    A message appears stating the following:

    The state of this instance is Active
    
    
  8. Click the Audit link to follow the instance execution process. Note that the SelectManufacturing service is pending. The RapidDistributors service has completed.

  9. Click the Flow link. Note that the parallel flow logic has completed on the RapidDistributors branch and is waiting on the SelectManufacturing branch (highlighted below).

    Description of obph3sel.gif follows
    Description of the illustration obph3sel.gif

    To access this part of the activity, present it to the user for pricing, and accept the user data for task completion and process continuation, you must invoke the task from your browser.

    The sample JSP pages and user presentation are prebuilt for you and deployed as SelectManufacturingUI. The JSP page displays a list of tasks waiting for user action.

  10. Access the prebuilt JSP Select Manufacturing application using Internet Explorer or Mozilla Firefox.

    http://localhost:9700/SelectManufacturingUI
    
    
  11. Click the order under Title.

    Description of obph3selui.gif follows
    Description of the illustration obph3selui.gif

  12. Provide a price in the Price field, and click Quote. This sends a form submit message on a JSP and completes the task. After processing, a message appears saying that the task has completed.

  13. Return to Oracle BPEL Console.

  14. Click the Instances tab at the top.

  15. Click the OrderBooking instance.

    A message appears stating the following:

    The state of this instance is Completed
    
    
  16. Click the Audit and Flow links and observe OrderBooking process instance execution to the end (observe each supplier's price quote).

4.3 Summary

You have now built parallel flow logic to call the asynchronous BPEL process to receive supplier prices from two services for a client order. You performed the following key tasks: