BPEL 1.1 Standard Faults Introduction to BPEL Standard Faults

Using Fault Handling in a BPEL Process 11-5 ■ Otherwise, if the fault data is a WSDL message type in which the message contains a single part defined by an element and there exists a catch activity without a faultName attribute that has a faultVariable whose associated faultElement’s QName matches the QName of the runtime element data of the single WSDL message part, the fault is sent to the identified catch activity with the faultVariable initialized to the value in the single part’s element. ■ Otherwise, if there is a catchAll activity, the fault is sent to the catchAll fault handler. ■ Otherwise, the fault is handled by the default fault handler.

11.3 Introduction to Categories of BPEL Faults

A BPEL fault has a fault name called a Qname name qualified with a namespace and a possible messageType. There are two categories of BPEL faults: ■ Business faults ■ Runtime faults

11.3.1 Business Faults

Business faults are application-specific faults that are generated when there is a problem with the information being processed for example, when a social security number is not found in the database. A business fault occurs when an application executes a throw activity or when an invoke activity receives a fault as a response. The fault name of a business fault is specified by the BPEL process service component. The messageType, if applicable, is defined in the WSDL. A business fault can be caught with a faultHandler using the faultName and a faultVariable. catch faultName=ns1:faultName faultVariable=varName

11.3.2 Runtime Faults

Runtime faults are the result of problems within the running of the BPEL process service component or web service for example, data cannot be copied properly because the variable name is incorrect. These faults are not user-defined, and are thrown by the system. They are generated if the process tries to use a value incorrectly, a logic error occurs such as an endless loop, a Simple Object Access Protocol SOAP fault occurs in a SOAP call, an exception is thrown by the server, and so on. Several runtime faults are automatically provided. These faults are included in the http:schemas.oracle.combpelextension namespace. These faults are associated with the messageType RuntimeFaultMessage. The WSDL file shown in Example 11–2 defines the messageType: Example 11–2 messageType Definition ?xml version=1.0 encoding=UTF-8 ? definitions name=RuntimeFault targetNamespace=http:schemas.oracle.combpelextension xmlns:xsd=http:www.w3.org2001XMLSchema xmlns=http:schemas.xmlsoap.orgwsdl message name=RuntimeFaultMessage part name=code type=xsd:string part name=summary type=xsd:string part name=detail type=xsd:string