Oracle® BPEL Process Manager Order Booking Tutorial
10g Release 2 (10.1.2) B15813-02 |
|
Previous |
Next |
This chapter of the tutorial describes how to build fault handling and exception management capabilities to catch exceptions.
This chapter contains the following topics:
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:
Design fault handling and exception management capabilities.
Deploy the BPEL process.
Run the deployed BPEL process from Oracle BPEL Console and submit an invalid social security card number to the Credit Rating service to check the client's credit history.
Review the credit rating results returned from the Credit Rating service to the client to see if the invalid social security number is identified.
This section contains these tasks:
Click the + sign to expand the GetCreditRating Scope activity.
Click Add Catch All Branch in the icons (third from the top) on the left side of GetCreditRating.
A new box displays to the right with the words Drop Activity Here.
Drag and drop an Assign activity from the Component Palette section into the Catch branch you just created.
Double-click the assign icon to display the Assign window.
Click the General tab.
Enter assignZeroCR in the Name field.
Click Apply.
Click the Copy Rules tab.
Click Create to display the Create Copy Rule window. You now create two fault handling rules.
Enter the following values:
Field | Value |
---|---|
From |
|
|
Expression |
|
'0' |
To |
|
|
Variable |
|
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. |
Click OK.
Click the Copy Rules tab.
Click Create to again display the Create Copy Rule window.
Enter the following details to create a second statement:
Field | Value |
---|---|
From |
|
|
Expression |
|
('Bad Credit, Rating = 0') |
To |
|
|
Variable |
|
Expand and select Variables > inputVariable > payload > ns1:PurchaseOrder > ns1:OrderInfo > ns1:OrderComments |
Click OK to close the Create Copy Rule window and the Assign window.
When complete, the designer window looks as follows:
Click the - sign to close the Scope activity.
Select Save from the File main menu.
Go to the Applications Navigator section.
Right-click OrderBooking.
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.
You are now ready to test the fault handling and exception management capabilities.
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.
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
Complete the manual price quote task for SelectManufacturing by using the graphical user interface JSP page, as described in Step 10.
Return to Oracle BPEL Console.
Click the Instances tab at the top.
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.
Click the OrderBooking instance.
Click the Audit link to follow the instance execution process.
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.
You have now built fault handling and exception management capabilities to catch exceptions in the Credit Rating service. You performed the following key tasks:
Designed fault handling and exception management capabilities in the BPEL process.
Deployed the BPEL process.
Ran the deployed BPEL process from Oracle BPEL Console and deliberately submitted an invalid social security card number to the Credit Rating service to check the client's credit history.
Reviewed the credit rating results returned from the Credit Rating service to the client. The invalid social security card number that you entered invoked the fault handling and exception management capabilities that you designed. A bad credit history message was returned to the client. The BPEL process was terminated before the Rapid Distributors and Select Manufacturing services were invoked.