Data Transformation Engine Type Designer Reference Guide
Chapter 8 - Components Defining Component Rules
Defining Component Rules
A component rule is an expression about one or more components. It indicates
what must be true for that component to be valid. For given data, it evaluates to
either TRUE or FALSE. A component rule is similar to a test. If the data does not
pass the test, it is invalid.
Component rules are used for validating data. Some important points about
component rules are:
♦ Only components of a group may have component rules. Components of a
category cannot have component rules.
♦ A component rule cannot be longer than 32K.
♦ If a component is optional and does not appear in the data, the component rule
is evaluated, after determining that the data is missing. In a component rule,
you can specify relationships that depend on existence or non-existence of
data.
Sometimes components have relationships among each other. For example, an
address field in purchase order data is preceded by a qualifier field which tells
whether the address is a bill-to or a ship-to address. If the value of the qualifier
field is
BT, the address field following it is a bill-to address. If the value is ST, the
following address is a ship-to address.
The qualifier and address fields are dependent on each other. They only make
sense as a pair. If one of these fields is optional and is missing, the other field is
not meaningful. If the qualifier is missing, you do not know whether the address is
a bill-to or a ship-to. If the address is missing, the qualifier does not qualify
anything!
You may want to define this kind of relationship and other relationships among
data objects. To do this, use a component rule. For example, use a rule on the
address field component to indicate that the qualifier must be present if the
address is present.
Note The following instructions, assume that the Enter key has been assigned to the
Commit changes with option in the General settings of the Options dialog.
To enter a component rule
1 In the group window, select the rule cell to the right of the component.