1. What is a validation rule?
Validation rules are logical checks on the consistency of data within a single AFD message. These rules typically involve dependencies between multiple data elements. While simple constraints on individual data elements – such as a required format or a maximum value – can be enforced via schema validation, more complex dependencies require separate validation logic.
Examples of validation rules include:
- A surcharge on the premium for third-party liability if the regular driver is under 24 years of age.
- A minimum deductible if the insured amount exceeds a certain threshold.
2. Validation rules and the AFD-definition Standard
The AFD-definition Standard provides a structured way to record and exchange validation rules, supporting consistency across different systems and implementations. These rules are always expressed as conditional statements that return either true or false. This ensures that validation logic is machine-readable and can be processed automatically.
The AFD-definition Standard supports two technical approaches for implementing validation rules, depending on the version of AFD:
- XPath is used for validation rules in AFD 1.0 messages (XML-based).
- JMESPath is used for validation rules in AFD 2.0 messages (JSON-based).
Although the syntax differs, the underlying logic and structure of validation rules are comparable in both approaches.
3. Implementation details
The technical implementation of validation rules is described in separate sections:
- See 3.3.1 Validation rules in XPath for implementation using XPath.
- See 3.3.2 Validation rules in JMESPath for implementation using JMESPath.
Post your comment on this topic.