Show validation failures to an operator
To determine the pages that are to be displayed to an operator, Datacap maintains a Status variable for each object in the runtime batch hierarchy. For example, a status of 0 indicates that operations on the object were successful while a status code of 1 indicates a problem or potential problem.
Datacap updates the status when rules are started.
Datacap uses other status codes, such as 49, which indicates that a page was scanned successfully. By default, Datacap displays all pages, but you can configure the TravelDocs application to display only pages with a status of 1. For more information, see the topic Page status.
The following problems result in a status code of 1.
- Unrecognized or low confidence characters: By default, if a page has any low confidence characters, Datacap sets the page status to 1. Fields with low confidence characters are displayed in yellow in the verify panel.
- Validation failures: If a field fails validation, Datacap sets the field status
to 1 and the page status to 1 and
displays the field in red in the verify panel.Important: When there is a validation failure, Datacap sets all parent objects’ status to 1, including the batch object. For example, if a subfield fails, Datacap sets the parent field to 1. The parent of the field (the page) is set to1. The parent document of the page is set to 1. The parent batch object status is set to 1. There is only one batch object in a batch.
Use of the Status_Preserve_OFF action in the rrunner library to set the status correctly. This action and the related Status_Preserve_ON action determine whether validation rules can update an object's status.
| Library | Action | Description |
|---|---|---|
| rrunner | Status_Preserve_OFF | Turns the Status Preserve setting of a page and its child fields to OFF, meaning validation rules can update an object's status if a validation fails. |
| rrunner | Status_Preserve_ON | Turns the Status Preserve setting of a page and its child fields to ON, meaning validation rules cannot change an object's status. |
In most situations, you want to make sure Status Preserve is turned OFF at the start of validation.
The default page-level rule Validate Page in the Validate ruleset that is generated by the Application wizard sets Status Preserve to OFF for you.
The rule is attached to the default page type, but you must attach it manually to any new pages that you create.
Reading the status variable
You cannot check the status variable for a page or field from within Datacap Studio. So, you must read the runtime batch data files:
- You can get the status of each page from the task profile's data file (for example, Profiler.xml).
- You can get the status of each field from the page data files
(for example, tm000001.xml).
Profiler.xml (page status) tm000001.xml (field status) <P id="TM000001"> <V n="TYPE">Rental_Agreement</V> <V n="STATUS">1</V> <V n="IMAGEFILE">tm000001.tif</V> etc. </P><F id="Pickup_Date"> <V n="TYPE">Pickup_Date</V> <V n="Position">194,402,563,458</V> <V n="STATUS">0</V> <C cn="10" cr="203,416,225,438">77</C> <C cn="10" cr="230,423,245,438">111</C> etc. </F>
In Profiler.xml, <P id="TM000001"> is the page definition. In tm000001.xml, <F id="Pickup_Date"> is the field definition.