Oracle® BPEL Process Manager Order Booking Tutorial 10g (10.1.3.1.0) Part Number B28987-01 |
|
|
View PDF |
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 Control 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 (fourth from the top) on the left side of GetCreditRating.
Click the + sign to expand the new branch.
A new box displays to the right with the words Drop Activity Here.
Select Process Activities from the Component Palette section.
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 Operation tab.
Click Create and select Copy Operation to display the Create Copy Operation 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 Operation tab.
Click Create and select Copy Operation to display the Create Copy Operation 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 Operation 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 Application Navigator section.
Right-click OrderBooking.
Select Deploy > my_integration_server_connection > Deploy to default domain.
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.
You are now ready to test the fault handling and exception management capabilities.
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).
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.
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
Complete the manual price quote task for SelectManufacturing by using the graphical user interface JSP page, as described in Step 11.
Return to Oracle BPEL Control.
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 Control 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.