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 > Flat Files > Reference
Business faults
The adapter supports business faults, which are exceptions that are anticipated and declared in the outbound service description, or import. Business faults occur at predictable points in a business process, and are caused by a business rule violation or a constraint violation.
Although IBM BPM and WebSphere Enterprise Service Bus support other types of faults, the adapter generates only business faults, which are called faults in this documentation. Not all exceptions become faults. Faults are generated for errors that are actionable, that is, errors that can have a recovery action that does not require the termination of the application.
For example, the adapter generates a fault when it receives a business object for outbound processing that does not contain the required data or when the adapter encounters certain errors during outbound processing.
Fault business objects
The external service wizard creates a business object for each fault that the adapter can generate. Also, the wizard creates a WBIFault superset business object, which has information common to all faults, such as the message, errorCode, and primaryKeySet attributes as shown in Figure 1.
Figure 1. The structure of the WBIFault business object
Some faults contain the matchCount attribute, to provide additional information about the error. For others, WBIFault contains all the information needed to handle the fault.
The WebSphere Adapter for Flat Files enables faults for you. Manual configuration of faults is not required. The adapter provides the following fault business objects that the wizard creates:
- DuplicateRecordFault
This fault is generated during the outbound Create operation when the file exists in the specified directory.
- RecordNotFoundFault
This fault is generated during Append, Delete, Overwrite, and Retrieve operations when the file does not exist in the specified directory.
- MissingDataFault
If the business object that is passed to the outbound operation does not have all the required attributes, the adapter returns this fault. This fault can occur for the Create, Delete, Update, Retrieve, ApplyChanges and Exists operations.
For example, the adapter throws this fault if the content of the specified file is null, or the file name or directory path is empty.