These
faults can be caught by a Catch handler specifically designed to catch the fault, or by
a more general Catch All fault handler.
??? ??? ??? ???
Chapter 9
[ 185 ]
The following sample BPEL process shows how an exception can be thrown if a
certain condition exists, and then how it can be caught and passed back to the
calling application.
Handling Events
[ 186 ]
To use fault handlers within a BPEL process, the WSDL describing the operations
for the partner link needs to have fault messages specified for each operation that
may return a fault. After we have ensured that fault messages are defined for our
operations, using a fault handler is a 3 stage process:
1. Decide when a fault needs to be thrown and assign a fault and description to
return to the caller.
2. Throw the fault.
3. Catch the fault and return it to the caller.
Deciding when a fault needs to be thrown is dependent upon the business logic
being performed by your application. The BPEL process designer provides lots of
functionality to enable you to catch specific error cases, for example:
Input values are outside of specific ranges
Boolean operations return false
Processing is performed outside of a specified date range.
When you have decided to throw a fault, you will most probably want to specify
an error message that can be returned to the calling application.
Pages:
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170