Global rules

Global rules enable pattern recognition and transformation of host input fields and work with customized and non-customized (default rendered) screens. They can be defined at both the project level and at the screen level. Use this section to specify project-level global rules. See Global Rules for where to define screen-level global rules.

If a project-level and a screen-level global rule are both defined for the same input field, the screen-level rule has priority.

As an example, you can create a global rule that renders any input field with the word Country before it as a drop-down containing codes for the various worldwide countries. Project-level global rules are truly global to your ZIETrans application; they work in screens both transformed by the rendering set, and also in custom transformations. This allows you to enable your entire application to recognize a particular host screen pattern without modifying any of your transformations.

A global rule consists of a configured pattern type and a transformation fragment. The pattern type configuration specifies what sort of content to look for on the host screen. It lets you transform specific fields or all fields of a certain size, or those nearest to a string you specify. For example, the pattern to recognize might be an input field preceded by the word Date. The transformation fragment contains the content to use to replace all occurrences of the pattern in all transformations. The transformation fragment might contain a ZIETrans input field component and a calendar widget. This would result in all input fields preceded by the word Date, across the entire application, displaying as a calendar control.

All configured global rules are displayed in the global rules table. Global rules are processed in the order they appear in this list at the beginning of every Apply transformation action. Once an input field is recognized by one global rule in the list, it will not be recognized by a subsequent global rule. The check box next to each item indicates whether the item is enabled or disabled.

  1. Click the Add button to add a global rule definition to the list of global rules for this project. If you do not have a screen capture, you will be prompted to open the host terminal to capture a screen. Creating a new global rule involves entering a Name and Description, and associating it with a Create a new transformation fragment. If you are editing a global rule, you can Use an existing transformation fragment.

  2. Next, select a pattern type to use. The pattern types to select from are as follows:
    • The Find input fields by surrounding text pattern type recognizes any input field which has a designated string bordering it on the left, right, top, or bottom. This pattern type requires you to select specific Pattern Settings. The designated string can contain one or more asterisks (*) used as wildcards. Spaces are significant. You can either Transform the nearest input field only or all input fields. Specify in the Located drop-down list where the text pattern must be in relation to the input field for the global rule to be applied. Insert the text for which you want this global rule applied in the A protected field containing field. If the Case sensitive box is used, it will search for the exact text specified. This pattern type is used by the Country and Date examples above.
      When you select All input fields for the Transform option, the first input field that matches the criteria determines the scope of the search region for subsequent fields. The example below shows the fields that are considered matches for all input fields below a protected field containing the string Enter.. The Global Rule Settings wizard highlights all of the matching fields. The first match is the field with the caption Alpha field (blue). The start and end columns of this field determine which fields below it are also considered matches. Notice the fields with captions Numeric field (green) and Column separators are not considered matches because they are either longer or shorter than the first matching field. The field with the caption Date field (pink), and the three fields immediately below it, are considered matches because they have the same start and end columns as the first matching field.
      Figure 1. ZIETrans global rule example
      ZIETrans global rule example
    • The Find all input fields pattern type successfully recognizes all host screen input fields. This pattern type has no pattern settings. A global rule using this pattern type should be placed at the bottom of the global rule list to give it the lowest priority.
    • The Find input fields by field size pattern type recognizes any input field which has a designated length. For example, this can be useful for transforming input fields of length one into check box controls.
    • The Find input fields within a specified region pattern type recognizes any input field located within a host screen region as specified by start row, start column, end row, and end column. Optionally, a field length can be specified to further define the input fields to locate within the region. A host field must be entirely contained within the specified region to be recognized. You can use this pattern type in conjunction with screen-level global rules to pinpoint an input field to customize on a screen, for example data within a table, while still using default rendering for the screen.

    Each pattern type component can contain a set of customizable settings as described above. As you change settings, the screen on the left is updated to reflect which input fields would match (note that multiple fields will be highlighted if multiple fields match). You can also highlight certain fields on your host screen by selecting the different options beside Highlight fields. If you want to see where the input fields are defined on the screen, select the Input check box. If you want to see what fields are protected, select the Protected check box. If you want to highlight any hidden fields, select the Hidden check box. To modify the colors of the input, protected or hidden fields highlighting, see Using ZIETrans preferences. If you are using an existing fragment, click Finish to update the global rule set and skip the section below.

  3. If you are creating a new fragment, you must now configure the ZIETrans component to be inserted into the transformation fragment. The purpose of global rules is to find input fields; therefore, only input components are displayed. The host screen region that is being used for configuration of this page is denoted by the selection box surrounding the first matched input field from the previous page, but remember that a project-level global rule will act on all matched input fields, on this host screen and all others. Select a component and widget, and configure their settings. Refer to the Insert Host Component or Edit Host Component for more details. Clicking Finish will update the global rules set and create a new transformation fragment in the Transformation Fragments folder. Make certain to save your project settings after finishing the wizard.

If you need to modify the component and widget settings of an existing global rule, you can go to the Rendering tab, select Global Rules and select the transformation fragment from the list then click Edit.

The transformation fragment is initially created with a special ZIETrans component which corresponds to the settings chosen on the third page of the global rule wizard. This component is special because it does not have region attributes. Instead, it dynamically obtains the region to render at runtime. You can edit this component as you would any other ZIETrans component, but on the first page of the wizard, you must select a global rule instead of a screen region. You can insert other valid ZIETrans transformation content into this transformation fragment as well.

Note: When you create a global rule, and then edit the transformation fragment, you are not able to see the output on either the design or preview tabs. To view the output, you must use the full page preview from the Edit Host Component function while editing either a transformation fragment or a full transformation that makes use of the global rule.

If you do elect to manually modify the transformation fragment associated with a global rule, it should not be done after using the editor from the Rendering tab. Doing this results in the wrong tag being read and the removal of any modifications made.

Project-level and applicable screen-level global rules are both applied in a screen event transformation. You can disable all global rule processing at the screen event level. To disable:
  1. In the ZIETrans Projects view, open the Screen Customizations, or the Screen Combinations, folder that contains the screen event.
  2. Double click the screen event.
  3. Click the Actions tab.
  4. Select the Apply a transformation action.
  5. Click Edit.
  6. Clear the Apply project-level and screen-level global rules check box.