Skip Headers
Oracle® BPEL Process Manager Order Booking Tutorial
10g (10.1.3.1.0)

Part Number B28987-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

6 Creating Fault Handling and Exception Management

This chapter of the tutorial describes how to build fault handling and exception management capabilities to catch exceptions.

This chapter contains the following topics:

6.1 Introduction

This phase of the tutorial adds to the OrderBooking process you designed in Chapter 5, "Adding Conditional Branching Logic". Ensure that you have successfully completed that phase before performing this one. In this phase of the tutorial, you build fault handling and exception management capabilities to identify a bad credit history. You perform the following key tasks:

6.2 Creating Fault Handling and Exception Management

This section contains these tasks:

6.2.1 Creating a Catch All Branch in the Scope Activity

  1. Click the + sign to expand the GetCreditRating Scope activity.

  2. Click Add Catch All Branch in the icons (fourth from the top) on the left side of GetCreditRating.

    Description of obph5catchall.gif follows
    Description of the illustration obph5catchall.gif

  3. Click the + sign to expand the new branch.

    A new box displays to the right with the words Drop Activity Here.

  4. Select Process Activities from the Component Palette section.

  5. Drag and drop an Assign activity from the Component Palette section into the Catch branch you just created.

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

  7. Click the General tab.

  8. Enter assignZeroCR in the Name field.

  9. Click Apply.

  10. Click the Copy Operation tab.

  11. Click Create and select Copy Operation to display the Create Copy Operation window. You now create two fault handling rules.

  12. Enter the following values:

    Field Value
    From
    • Type
    Expression
    • Expression
    '0'
    To
    • Type
    Variable
    • Variables
    Expand and select Variables > invokeCR_process_OutputVariable > payload > ns1:rating

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


  13. Click OK.

  14. Click the Copy Operation tab.

  15. Click Create and select Copy Operation to display the Create Copy Operation window.

  16. Enter the following details to create a second statement:

    Field Value
    From
    • Type
    Expression
    • Expression
    ('Bad Credit, Rating = 0')
    To
    • Type
    Variable
    • Variables
    Expand and select Variables > inputVariable > payload > ns1:PurchaseOrder > ns1:OrderInfo > ns1:OrderComments

  17. Click OK to close the Create Copy Operation window and the Assign window.

    When complete, the designer window looks as follows:

    Description of obph5.gif follows
    Description of the illustration obph5.gif

  18. Click the - sign to close the Scope activity.

  19. Select Save from the File main menu.

6.2.2 Validating, Compiling, and Deploying the Order Booking Process

  1. Go to the Application Navigator section.

  2. Right-click OrderBooking.

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

  4. Increment the version number of the project when prompted and click OK (for example, enter 1.4).

    This compiles the BPEL process. Check for errors by clicking the buttons at the bottom of the window. If there are no errors, deployment was successful. If deployment was unsuccessful, see Step 4.

6.2.3 Running the Order Booking Process

You are now ready to test the fault handling and exception management capabilities.

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

  2. Enter the following details to log into Oracle BPEL Control and click Login:

    Field Value
    Username oc4jadmin
    Password password

    Where password is the value you entered during installation.

    The Dashboard tab of Oracle BPEL Control appears.

  3. Start the OrderBooking instance version you increased in Step 4 in one of the following ways:

    • Click OrderBooking in the Deployed BPEL Processes list. Enter a nine-digit integer value that begins with zero in the CustID field of the HTML Form and click Post XML Message to post a message. This action invokes an exception in the Credit Rating service.

    • Open the provided CreateOrderBookingUI application at http://localhost:8888/CreateOrderBookingUI and provide inputs to initiate a process. Ensure that you overwrite the default value with zero in the CustID field.

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

    Test Instance Initiated
    
    
  4. Complete the manual price quote task for SelectManufacturing by using the graphical user interface JSP page, as described in Step 11.

  5. Return to Oracle BPEL Control.

  6. Click the Instances tab at the top.

  7. Verify that the OrderBooking instance was created. The instance should appear in the Instance list. The Last Modified list displays the time at which the instance was created.

  8. Click the OrderBooking instance.

  9. Click the Audit link to follow the instance execution process.

  10. Observe that the steps were executed and the exception was caught and handled in the process flow. Inside the scope block, a bad credit exception was raised, the exception was processed in the exception block, a default value of 0 was assigned, and processing continued.

    Description of obph5fault.gif follows
    Description of the illustration obph5fault.gif

  11. Click the Flow link to observe additional details.

6.3 Summary

You have now built fault handling and exception management capabilities to catch exceptions in the Credit Rating service. You performed the following key tasks: