IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > Adapter Toolkit > Implementing code from the IBM WebSphere Adapter Toolkit > Problem determination > Fault handling support
Defining custom faults
You can define custom faults for fault handling.
- Define the fault class
Implement BaseFaultException and define additional attributes if necessary. In defining the BaseFaultException class, you can see the convention for specifying the fault name.
For example, the RecordNotFoundException fault name is RECORD_NOT_FOUND.
- Define a fault binding
Only required if you have defined additional attributes for your fault.
- Define the fault business object
You can use the FaultBOUtil to define the fault business object, as long as either no attributes or only simple attributes are added. This should amount to a few lines of code, see Implementing Faults for an example.
The model for fault classes and fault business objects is a 1-to-1 relationship, the base fault business object cannot be used even if no additional attributes are needed. This is because SCA does not pass back the fault name to the client / server runtime. Instead, the fault name is resolved to the fault (BO) type. So if you reuse fault BOs, you cannot definitively determine which fault occurred.
Related concepts:
Configuration for fault handling
Related reference: