Skip to main contentRules are one of several tools that ABBYY Vantage offers for automatic verification of extracted data. Rules let you set up conditions that specific fields will need to satisfy. A rule that only involves repeating fields from the same group (table) will itself be repeating. This means that it will be applied sequentially to all instances of the repeating fields (starting with the first instances, then the second instances, an so on). Rules like this can be used to process values in each row of a table. Documents that have fields that do not satisfy one or more rules will be sent to manual review. Rules can also be used to modify extracted data (such as sum up several fields).
Rules are executed in a predefined order designed to meet the following conditions:
- All rules that attempt to read data from a field are executed after the rules that write a value to that field.
- When a rule checks one field and writes data to a second field, and another rule checks the second field and writes data to a third field, the rules are executed one after another.
- When multiple rules attempt to write data to a field simultaneously, these rules are executed in the order of their creation.
- When a rule reads one field and writes data to a second field, while another rule reads the second field and writes data to the first field, an error will be returned.
If the operator modifies the value of a field during manual review, it will be checked again using any applicable rules. If the operator only changes the value of a single instance of a repeating field (for exmaple, a table cell) in a repeating rule, the rule will be applied a second time only to the modified instance.
Creating a rule
To create a field verification rule, click the New rule button in the field properties. In the dialog box that will open, a list of all existing Vantage rules will be displayed. To add a new rule, specify a name for it as well as the fields that should be checked. Do this by selecting the names of the appropriate fields from the drop-down list.
You can also create a custom rule using a script. For more information, see the Business Rules Automation section.
Built-in rules
- Check Sum. Adds together the values of several fields and compares the result to the value of another field. This rule can only process Number and Money fields.
- Check Product. Multiplies together the values of several fields and compares the result to the value of another field. This rule can only process Number and Money fields.
- Compare. Compares the values of several fields.
- Merge. Merges the values of several fields. The merged value will be recorded in the specified field (should be created in advance). When merging fields, you can add separators from the provided list.
- Data Catalog Lookup. Checks the values of document fields against the corresponding records from a data catalog. For more information, see Setting up data catalog lookup rules.
Using tables in rules
All built-in and custom rules can be applied to table cells by specifying a column as a field. The rule is then applied to all cells in that column. A single rule can reference column tables and fields outside of that table at the same time.
The Check Sum and Check Product rules can be used to perform the following actions with tables:
Compare the sum/product of all cells of one or several columns to the value of a field outside of that table
In the Add Up Fields or Fields to Multiply fields, specify the columns that will be used to perform the action. These columns can belong to different tables. If you specify only one argument, the rule will still run correctly. In the Compare Sum with or Compare Product with field, specify the field that is located outside of the table. All cells in the columns will be transformed into input parameters that will be used to carry out the specified action once.
Compare values from different columns row-by-row
If columns from the same table are specified in the Add Up Fields (Fields to Multiply) and Compare Sum with (Compare Product with) fields, this sets up a repeating rule that is carried out for the specified cells of every row in the table. For example, this can be used to check whether the total amount for each line item in an order was specified correctly. This is done by multiplying the price of one line item unit by the number of units ordered.
Compare values from different columns to a field outside of the table row-by-row
If a table column and a field outside of the table are passed as parameters in the Add Up Fields (Fields to Multiply) fields, and if a column from that same table is passed in the Compare Sum with (Compare Product with) field, this sets up a repeating rule with a constant parameter (the value of the field outside of the table). This rule will be carried out for each row in the table.