Business validation rules
First, you define the structure of each document type and the fields that you want to capture from each page. Then, you define how you want to validate the captured data to determine whether the data meets the business requirements.
For simplicity purposes in the sample application, you validate some of the fields only. You selected these fields specifically to demonstrate a few generic but commonly used techniques when you implement the data validation stage of the application workflow.
| Page | Field | Validation rule |
|---|---|---|
| Rental Agreement | Total Cost | Is the field value in a valid currency format? Specifically, is the field numeric with a two-digit decimal portion? |
| Optional Insurance | Total Cost | Is the field value in a valid currency format? Specifically, is the field numeric with a two-digit decimal portion? |
| Room Receipt | Total Cost | Is the field value in a valid currency format? Specifically, is the field numeric with a two-digit decimal portion? |
| Meals | Total Cost | Is the field value in a valid currency format? Specifically, is the field numeric with a two-digit decimal portion? |
| Other Charges | Total Cost | Is the field value in a valid currency format? Specifically, is the field numeric with a two-digit decimal portion? |
| Air Ticket | Air Fare Taxes Total Cost |
Is the field value in a valid currency format? Specifically, is the field numeric with a two-digit decimal portion? |
| Rental Agreement | Car Type | Is the field value one of the following values: Compact, Standard, Full size, SUV, or Other? |
| Air Ticket | Air Fare Taxes Total Cost |
Does the value of the Air Fare field plus the value of the Taxes field equal the value of the Total Cost field? |
A validation failure does not necessarily mean that the original page contains invalid data. It might mean that the recognition engine failed to recognize one or more characters correctly. Whatever the reason for the error, the application developer can set the page status to ensure that the page is displayed to an operator for verification.