Rule validation

Rules offer an additional means of checking captured data. You can use rules to specify certain restrictions that apply to the data in particular fields (or, to put it another way, conditions to be met by the values captured from particular fields).

Additionally, you can use rules to process captured values. For instance, you can merge values from multiple fields, or substitute captured values by values taken from a database.

You can specify how strict a rule is, i.e. whether it should issue a warning or an error if it is violated. Fields with rule warnings will be marked with a yellow flag and fields with rule errors will marked with red flags. See Rule validation for details.

Rules are set up on the Rules tab of the properties dialog box of a field, section, Document Definition or another item for which rules can be specified.

Viewing rules

Use the Show rules drop-down list to choose which kind of rules to display:

  • refer to %0 Shows only the rules that refer to the current object.
  • owned by %0 Shows only the rules that are stored in the current object.
  • owned by %0 and its children Shows only the rules that are stored in the current objects and its child objects (e.g. if the object is a group, the rules stored in the group will be shown together with the rules stored in fields that are part of the group).

Note: In the rule display options above, “%0” will be replaced by the name of the current object.

Note: A new rule can be created if you choose to show rules owned by %0 and owned by %0 and its children. You cannot create a new rule if you select rules that refer to %0.

Filtering rules

Setting up rules

The list of rules contains all rules that have been set up and some additional criteria of each rule.

To create a new rule, click the New Rule... button on the Rules tab. In the dialog box that opens, select the type of rule you want to create and click OK. This opens the New Rule which contains the following options:

  • Name - The name of the rule.
  • Show rule name in message to verifier - Enable this option if you want error notifications to contain the name of the rule that yielded the error. By default, notifications about rule errors appear as follows: "name of rule: error message". If this option is disabled, the notification will only contain the error message.
  • Severity - The severity of the rule. When a rule yields an error, an error message and a flag are generated. There are two possible flags: Error or Warning types.
    When an attempt is made to export documents with rule errors, a notification about this will be displayed. Documents with rule errors can still be exported
    Note: This option is not available for rules of the Calculate Sum and Merge Fields.
  • Apply rule - Options in this group let you determine when a rule is applied.
    • Always The rule is always applied, i.e. it will be applied whenever changes are made to the fields monitored by the rule. This option is enabled by default.
    • If this condition is true If this option is enabled, the rule will only be applied when certain conditions are fulfilled. For details, see the Conditions for applying rules section of this article.
  • Tags are used for filtering rules.
    Note: Use commas without spaces to separate values. Tag values are case-sensitive.
  • Enabled rule - Enables or disables the rule.

The following options depend on the rule's type:

  • Calculate Sum Calculates the sum of the values of several fields and writes it to another field.
  • Check Sum Calculates the sum of the values of several fields and checks it against a pre-defined number or the value of another field.
  • Compare Fields Compares the values of several fields.
  • Database Check Checks captured values against their counterparts taken from a database.
  • Merge Fields Merges the values of several fields. You can add any type of separator when merging field values into one.
  • Script A user-defined script that describes restrictions that apply to specific data.
  • Sum in Figures - Sum in Words (Russian) Compares a sum written in words with the same sum written in digits (works only on Russian-language texts).

Note: If a rule is set for a repeating field group, it will be applied field-by-field to each group instance individually. If a rule is set inside a group, then that rule will be applied only to that particular group instance.

Conditions for applying rules

In the current version of ABBYY FlexiCapture, rules can be triggered when a certain field has a specific value. When you create or edit a rule, you can specify when you want the rule to be applied by selecting the Always or If this condition is true option. If you want to specify a condition that triggers the rule, select the If this condition is true option and then click the Edit button to the right of this option to open the Condition for Applying Rule dialog box. In this dialog box:

  • Select a desired field.
  • Select the condition that must be fulfilled to trigger the rule.
    • Belongs to set The rule will be applied if the value of the field matches one of the allowed values you specified.
    • Does not belong to set The rule will be not applied if the value of the field matches any of the prohibited values you specified.
    • Is empty - The rule will be applied if the field value is empty.
    • Is not empty - The rule will be applied if the field value is not empty.
  • You can also specify a range of possible (permitted) values of a field.
  • To add a value to the set of possible values, type in the value and click Add. To delete a value from the set, select the value and click Delete. You can also add an empty value to the set of possible values. To add an empty value, click Add without typing any values. The empty value will appear as in the set of possible values. A value can be added only once.

Conditions for applying rules can only involve text fields (including fields with continued regions), barcodes, and table columns. Conditions for applying rules cannot involve checkmarks, checkmark groups, fields with multiple instances, images, or table cells.

Important! If the Show on verification option is not enabled in a field's properties, errors related to this field will not be displayed during verification. This means that the document with this field will have an error flag that cannot be removed.

Rule chains

Rule chains are groups of rules with a specific order of application. This lets you set up several rules that involve the same field.

To create a rule chain:

  • Click the Chains button in the Rules tab.
  • In the dialog box that opens, click the New Chain... button.
  • Provide the name of the rule chain and a comment (optional).
  • Click OK.

The new rule chain will be displayed in the list in the Chains dialog box. Next, add rules to the rule chain. To do so:

  • Click the Add Rule... button.
  • Select the desired rules.
  • Use the Move Up and Move Down buttons to arrange the rules in the order you want them applied.

Important! Each rule can only be a part of one chain.

Note: If you try to add a field that can be edited - the Read-only option is disabled in its properties to a rule, but this rule is already involved in a chain of rules where it can also be edited, you will be prompted to merge this rule with the chain of rules. If you agree to do so, and the rule to which you added the field belongs to another chain, the two rule chains will be merged into one.

Where rules are stored

Language used for rule validation errors

When documents are processed automatically, rule validation errors are by default reported in the UI language of the Processing Station component (i.e. the language that was selected when installing ABBYY FlexiCapture).

However, some operators may prefer to see error messages in a language other than the default language (for example, if manual and automatic processing are carried out in different countries).

To specify different languages for different operators, create a separate batch type for each language. In each batch type, specify the language to be used for error messages issued during automatic processing:

  1. On the Project Setup Station, click Project > Batch Types…
  2. Create a new batch type (or select an existing batch type and click Edit...).
  3. On the Verification tab, select Use this language for messages issued during processing.

Rule validation errors can be reported in any of the following languages:

    • English
    • Hungarian
    • Spanish
    • Chinese Simplified
    • Korean
    • German
    • Polish
    • Portuguese (Brazilian)
    • Russian
    • Serbian
    • French
    • Czech
    • Japanese
  1. Save your changes.

Note: If an operator makes corrections which are then immediately checked by validation rules, any error messages issued by such repeat checks will be displayed in the ABBYY FlexiCapture UI language. This is because all such processing is done locally rather than on the Processing Station. This applies to all error messages on desktop stations and format errors on web stations.

Important! The following types of error messages are only available in English: errors reported by script rules, document assembly errors, and key field matching errors.

12/1/2020 7:03:59 AM


Please leave your feedback about this article