Mapping of validation error reason codes

You can map error reason codes to Management Center objects for a more descriptive error response.

Before you begin

If a request cannot be processed because of business logic validation errors, the BOD response contains error information in the change status element in the Verb. The change status contains a reason code element that consists of a unique string representing the application error. In most cases, these unique reason codes correspond to a property of the Management Center object. By updating the validation error mapping, each Management Center object can associate reason codes with a particular property so that the error response to the Management Center can highlight the properties that cause the problem.

About this task

To associate reason codes with a particular property of the Management Center object:

Procedure

  1. Open WebSphere Commerce Developer.
  2. Open one of the Management Center object definition files. Choose the file that describes the object with which you are working.
  3. In the validation error mapping section, identify the validation object element that contains the reason code mapping. If one does not exist, create a new validation object element for the Management Center object.
  4. Add a new ReasonCodeMapping for the service reason code and the property of the Management Center object with which it should be associated.
  5. Save the file.
  6. Restart the WebSphere Commerce Server and test your changes.
  7. Deploy your changes to your production environment.