About Extended Rule Processing
You can specify pre- and post-session rules in the Session Rules dialog box. Pre-session extended rules are processed before the translation object is processed, and are applied to every extended rule defined in the map. Post-session rules are run after the translation object is processed.
The scope of an extended rule determines which variables are accessible from within the extended rule. The scope varies according to the following criteria:
- Pre-session extended rules (defined in the Session Rules dialog box) are in scope for every rule in the map.
- On Begin extended rules (defined in the Loop Extended Rules tab) apply until the conclusion of companion On End rules (also defined in the Loop Extended Rules tab).
Note: For looping records or groups, On Begin and On End rules process once for each occurrence of the loop, at the beginning and end of each loop respectively.
- Field-level extended rules apply only for the duration of the field.
An extended rule attached to the current map component depends on the type and state of the map component.
For example, if a current group to which the rule is attached is subordinate to another group, the parent group is automatically in scope for the duration of the child group, and the current hierarchical structure is also in scope for the duration of the child by using an addressing method. For more information about syntax and addressing methods, see Symbol Syntax.
An extended rule that is attached to a field applies only for the duration of the field. Field-level extended rules are always processed after standard rules.
A variable is considered to be in scope if it was declared in the current rule, in the On Begin rule of a group that contains the current map component, or in the pre-session rule.
The translator creates the data storage area for a map according to the structure of the input side (the source side) of the map. The data storage area (Internal Storage) is created in memory on the system performing the translation. Therefore, extended rules address the map according to the hierarchy of the input side. When you use extended rules, you must be careful to address the input side of the map so the translator can locate the map component that the rule accesses. On the output side of a map, extended rules can access only the current record and the input side of the map. However, from the input side of a map, extended rules can access the entire file structure. As long as you address the input side of a link, you can write to any field on the output side.
For more information, see: