Skip to main content
Group is a collection of several elements (called subelements). Subelements, in turn, can be Group elements. Group elements are marked with Group element icon in the FlexiLayout tree.
Group elements also include Header, Footer, First Found, and Repeating Group.Use Header and Footer elements to detect the beginning and the end of a document. Each may occur in a document only once.Repeating Group is a recurring Group element. A Labeled Field element can also be represented as a compound element.

How Group elements are detected

If required, you can specify the minimum number of subelements to be detected. If fewer subelements are detected when the FlexiLayout is applied, the compound element is deemed not detected. A Group element, just like a simple element, can be required, optional, or prohibited. If an optional Group element includes a required element, the failure to match this element with an object results in a null hypothesis for the Group element, and the program continues trying to match the FlexiLayout. Avoid keeping empty compound elements (that is, compound elements without any subelements). If the program encounters an empty compound element when compiling a FlexiLayout, it displays a warning message. Header and Footer elements are added by default. If your FlexiLayout does not use them, delete these redundant elements.

When to use Group elements

Group elements are useful in the following cases:
  • To make testing independent parts of a FlexiLayout easier. For example, a FlexiLayout made up of 100 elements may include only 3 Group elements: the title, the body, and the bottom of the document. Each of these three Group elements contains Group elements that describe smaller portions of the document. This approach both limits the number of possible variants to consider and makes debugging the FlexiLayout easier, because each group can be edited and tested independently.
  • To make navigation in the FlexiLayout tree easier.
  • To reduce the number of possible element hypotheses, thereby speeding up the formulation of the final hypothesis. Grouping elements together lets the program consider a set of elements as one whole, for which a single hypothesis is formulated (albeit consisting of the hypotheses for subelements) and for which the quality can be calculated. Various combinations of subelement hypotheses are considered inside the group, and only a set number of the best group hypotheses are used in the search down the tree. The default number of best hypotheses for a Group element is 1.
    Increasing the maximum number of hypotheses is not recommended, as this may lead to an uncontrollable growth of the tree and failure to match the FlexiLayout with the images.
  • To specify a search constraint common to all of the subelements. The search area for a particular element will be calculated as an intersection of the search area specified in the subelement and the search area of the entire group.
    Sometimes, the intersection of the search area of a Group element and one of its subelements may be empty, and the program will fail to find the subelement. Try to specify only simple relations for Group elements, for example, Above: PageRect.Top + PageRect.Height/2; (that is, “look for the element in the upper half of the image”), or not specify any relations at all.