Sie sind auf Seite 1von 13

Segment #6

Fault Handling
Fault Handling

Problem/Use Case

“The Credit Rating service throws a {http://services.otn.com}NegativeCredit


fault under certain conditions. How do I catch and manage a fault from within
a BPEL process?”

Negative
Credit
Fault!

Credit Rating Service

2004.07 BPEL PM Training - Slide 60


Fault Handling

BPEL Concepts | Fault and WSDL

WSDL of credit rating service

2004.07 BPEL PM Training - Slide 61


Fault Handling

BPEL Concepts | <scope>, <faultHandlers>/<catch>

d1 <receive> Negative
Credit!
<scope>

prepare crIn
<assign>

d3
Call service
<invoke> f1

Credit Rating
Service
Read crOut
<assign>

<catch NegativeCredit>

credit to -1000
<assign>

d2
<reply>

BPEL Process

2004.07 BPEL PM Training - Slide 62


Fault Handling

BPEL Concepts | Source Code Review

<scope>
<scope> isis aa wrapper
wrapper element.
element. ItIt
allows
allows us
us to
to catch
catch aa number
number of
of
exceptions
exceptions

<catch>
<catch> NegativeCredit
NegativeCredit exception
exception
thrown
thrown by
by CreditRating
CreditRating service
service
(when
(when SSN
SSN starts
starts with
with 0)
0)

Handle
Handle exception
exception by
by setting
setting credit
credit
rating
rating to
to ‘-1000’
‘-1000’

2004.07 BPEL PM Training - Slide 63


Fault Handling

BPEL Designer | Overview

Wrap activity Add <catch> to Implement <catch>


in <scope> <scope> body

2004.07 BPEL PM Training - Slide 64


Fault Handling

BPEL Designer | Add <catch> to <scope>

Add
Add new
new <catch>
<catch> to
to
<scope>
<scope>

Click
Click to
to drill
drill into
into
<catch> implementation
<catch> implementation

2004.07 BPEL PM Training - Slide 65


Fault Handling

BPEL Designer | Implement <catch> body


Navigate
Navigate back
back to
to scope
scope element
element

Model
Model <catch>
<catch>
process
process logic
logic

2004.07 BPEL PM Training - Slide 66


Fault Handling

BPEL Console | Deploy And Testing

2004.07 BPEL PM Training - Slide 67


Lab Exercise

Lab 6: Fault Handling


1. Add a <faultHandler> to your scope enclosing the credit rating
service to handle the NegativeCredit faults which may be thrown
by the service.
2. Handle the faults in an automated fashion (here, just set the
creditRating value to -1000).

Extra Credit #1: Add a catchAll to catch unhandled faults. Then undeploy your
CreditRatingService and see how the system fault can be caught and handled.

Extra Credit #2: Use your neighbor’s CreditRatingService as a failover service and run
your flow again to see how the failover capability works.

2004.07 BPEL PM Training - Slide 68


Fault Handling

What Did We Learn?

• How to read a WSDL file to determine that a service


invocation might generate a fault
• How to wrap an <invoke> activity into a scope to be
able to catch and manage a fault

2004.07 BPEL PM Training - Slide 69


Fault Handling

Related Material

• See Tutorials 107.ExceptionSample for how to handle


asynchronous error messages using <pick>
• Business exceptions versus system faults
• Configuring retries and load balancing for runtime
exceptions
• Making BPEL processes resilient using user tasks and
JMS dead letter queues (Tech Note # BPEL-TN007)

2004.07 BPEL PM Training - Slide 70


Fault Handling

Related Material – System Faults

• Oracle BPEL PM defines two kinds of system faults:


– RemoteFault (which is re-tryable)
– BindingFault (not re-retryable)
– Both in namespace
"http://schemas.collaxa.com/bpel/extension”
• See technote on Runtime Faults for more information

2004.07 BPEL PM Training - Slide 71

Das könnte Ihnen auch gefallen