Skip Headers
Oracle® BPEL Process Manager Order Booking Tutorial
10g Release 2 (10.1.2)
B15813-03
  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
 

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 (third from the top) on the left side of GetCreditRating.

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

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

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

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

  5. Click the General tab.

  6. Enter assignZeroCR in the Name field.

  7. Click Apply.

  8. Click the Copy Rules tab.

  9. Click Create to display the Create Copy Rule window. You now create two fault handling rules.

  10. 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.


  11. Click OK.

  12. Click the Copy Rules tab.

  13. Click Create to again display the Create Copy Rule window.

  14. 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

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

    When complete, the designer window looks as follows:

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

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

  17. Select Save from the File main menu.

6.2.2 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 of the project when prompted and click OK (for example, enter 1.4).

    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.

6.2.3 Running the Order Booking Process

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

  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. Start the OrderBooking instance version you increased in Step 5 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:9700/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
    
    
  3. Complete the manual price quote task for SelectManufacturing by using the graphical user interface JSP page, as described in Step 10.

  4. Return to Oracle BPEL Console.

  5. Click the Instances tab at the top.

  6. 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.

  7. Click the OrderBooking instance.

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

  9. 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

  10. 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: