How to use non-enumerated Custom Data Types in Rulesheets and Ruletests

Non-enumerated custom data types use Constraint Expressions and do not cause Rulesheet drop-down lists to become populated with custom sets. Also, manually entering a cell value that violates the custom data type's Constraint Expression is not prohibited in the Rulesheet. For example, in the following figure, weightRange is defined as a non-enumerated custom data type with Base Data Type of Decimal.

Figure 1. Non-enumerated Custom Data Types

Then, after assigning it to the Vocabulary attribute Cargo.weight, it is used in a Rulesheet Condition row as shown:

Figure 2. Using Custom Data Types in a Rulesheet

Notice in the preceding figure that the 300000 entry violates the Constraint Expression of the custom data type assigned to Cargo.weight,  but does not turn red or otherwise indicate a problem. The indication comes when data is entered for the attribute in a Ruletest, as shown:

Figure 3. Violating a Custom Data Type's Constraint Expression

Notice that the small yellow warning icon  indicates a problem in the attribute, entity, and both Ruletest tabs. Such an error is hard to miss.  Also, a Warning message will appear in the Problems tab (if open and visible) as shown. If the Problems tab is closed, you can display it by selecting Window > Show View > Problems from the Studio menubar.

Figure 4. Violating the Constraint Expression of a Custom Data Type

A Warning does not prevent you from running the Ruletest. However, an Error, indicated by a small red icon , will prevent the Ruletest execution. You must fix any errors before testing.