English (English)

Using instances of a Repeating Group as reference, excluded or source elements

You can use the element selection dialog box to select:

  • a reference element on the Relations tab of an element's Properties dialog box
  • an excluded element on the Search Constraints tab of an element's Properties dialog box
  • a Source element in a block's Properties dialog box

For simple elements, their names are used. For a Repeating Group element, a reference to the hypotheses for the repeating group (taking into account the number of the instance) is used to create relations.

When matching a FlexiLayout, several instances of hypotheses for the repeating group will correspond to one Repeating Group element in the tree of elements. Therefore, when specifying relations between a Repeating Group and other elements, you must specify which instance should be used. When you specify a reference to a hypothesis rather than a full name, the name of the Repeating Group is followed by a full stop and a description of the referenced instance.

The instance may be:

  • LastFound - the last detected instance of the Repeating Group at the moment when a hypothesis is generated for the given subelement
  • AllInstances - all the detected instances of the Repeating Group
  • Instance(#) - a particular number of the instance
  • CurrentInstance - the current instance; used when specifying relations between a subelement of a Repeating Group to refer to the current hypothesis for the group itself, i.e. to already detected subelements of the group that are located above the given subelement in the tree

The syntax of the reference in the element selection dialog box is the same as the syntax used in code you type in the Advanced sections to access the instances of a Repeating Group and their subelements. For example:

SearchElements.RepeatingGroup.LastFound.RepeatingGroup1.Instance(1). StaticText.

An instance of a group is selected in the dialog boxes where you select a reference element or an excluded element. In the selection tree, the instance numbers are indicated next to the names of repeating groups. When you select a repeating group, a Repeating instance field becomes available, where you can select the desired instance. The changes you make will be reflected both in the tree and in the result string.

When you select CurrentInstance for a child group CurrentInstance is automatically set for all the groups above it. If you change the CurrentInstance of a parent group to something else, the instances of all the child groups will be reset to the default value of LastFound.

When you select AllInstances for a parent group, AllInstances is automatically set for all the child groups. If you change the AllInstances of a child group to something else, the AllInstances of the parent groups will be reset to the default value of LastFound.

When creating a reference manually in the Advanced code, keep in mind that CurrentInstance can only be specified for a parent group, and if you specify CurentInstance for a group, all the groups above it must also have CurrentInstance specified for them. If AllInstances is specified for a group, all the groups below it must also have AllInstances specified for them. When you select group instances in the dialog box, the correct values are enforced automatically.

See also:

Search constraints

Relative search area

Additional search constraints

12.04.2024 18:16:02

Please leave your feedback about this article

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.