After dictionary structure as blocks is determined, one should bind these blocks to data sources containing records about dictionary elements on the Block Bindings page. To do this, in each block map dictionary attributes with corresponding table fields.
To bind source fields to dictionary block attributes execute one of the following operations:
In the Data Sources area select a field in a data source, in the Dictionary Blocks area select the required attribute and click the Bind button in the web application or the Bind button in the desktop application.
In the Data Sources area select a source field and drag it to the attribute area.
After that the binding is made, and values of the bound source field act as values of element attribute. Attributes of one block should be bound to the fields of one and the same source.
Parameters of element filtering
To enable filter, double-click the Filter element of the selected block. In the opened dialog box of the expression editor set an expression, according to which the elements, that will be in dictionary, should be selected. The expression should return logical value. The dictionary contains only the elements left, for which the expression returns True.
Dictionary fields, dictionary attributes and various functions and operators are available to use in the expression.
Set up recursion in recursive blocks
To create element hierarchy, you need to define a condition based on which parent and child elements should be interrelated. Use the Recursion block to set up element hierarchy in the following steps:
Under the Top Level subelement define the criteria based on which root block elements are selected. These elements are displayed at the topmost level, they will be parents of all the other elements. Double-click the Top Level element to define the selection expression. In the dialog box of the expression editor specify the condition of selecting root elements.
Under the Link by Index subelement, select the index that contains the attributes which values are used to link the <Parent Element>-<Child Element>. To select index, double-click the Link by Index element:
NOTE. If the dictionary has only one index, link by index is automatically based on this index.
One should assign an attribute, by which child element values should be obtained, to each attribute included into index. These values are searched in the values of an attribute included into the index. The found value corresponds to the parent element. To link an attribute included in the index structure, double-click it, and in the opened window of the expression editor select dictionary attribute.
Therefore, parent elements will be searched by the attribute included in the index. Required values of child elements are searched by the attribute linked to the index attribute.
Duplicates are deleted to solve the conflicts arising due to non-unique dictionary indexes. To set up duplicate deletion options, click the Duplicates Deletion Options button:
In the web application use the Delete Duplicates settings area on the Block Bindings page.
Select an element selection method:
Do not Show Elements List.
Choose Element by Maximum Expression Value. This option deletes the elements that match the maximum value of the expression specified in the Expression Editor dialog box. To open the expression editor, click the Set Expression button in the web application or the Set Expression button in the desktop application.
Choose Element by Minimum Expression Value. This option deletes the elements that match the minimum value of the expression specified in the Expression Editor dialog box. To open the expression editor, click the Set Expression button in the web application or the Set Expression button in the desktop application.
Consider the example. A block primary index includes the Identifier attribute. Primary index implies that values by this attribute are unique. If integrity of primary index is violated on dictionary opening due to multiple records having the same value of the Identifier attributes, the program attempts to delete duplicates. If the settings, shown on the figure above, are used, the value of the Order attribute is calculated for all duplicate records. Element with the maximum value of this attribute will be saved to the resulting collection of dictionary elements.
See also: