How You Create Statement Rules

Statement rules are the type of rule you use to build configuration constraints between elements of a model.

Creating a Statement Rule

To create a statement rule, you use the rule editor in the Configurator Models work area.

The following table presents the actions required to create statement rules, and the reason for each action.

Action

Reason

1. On the Rules tab of the Edit Configurator Model page, create a statement rule by selecting Create > Statement Rule from the Actions menu.

Configurator rules are created as statement rules.

The new rule appears in the Rules pane. You can create rule folders there to keep your rules organized.

You can create several statement rules and work on them concurrently. A statement rule can contain multiple statements.

2. In the Create Statement Rule dialog box, type in a name, and an optional description, and select a rule class.

The rule class governs how the rule is used during configuration. You can change the rule class later.

3. Enter the text of the rule in the text pane below the button bar in the Definition region.

Statement rules must be written in the Constraint Definition Language (CDL).

3a. Use the menus to insert CDL syntactical elements into the rule text.

Using the menus guarantees that you will insert only valid syntactical elements. However, you must validate the statement rule to guarantee that it's syntactically valid as a whole, and test the rule in the model to determine whether it performs as expected.

3b. Use the Structure pane to reference model structure nodes.

Your CDL statements contain many references to nodes of the model structure. To insert a syntactically correct reference to a node, search for and select it in the Structure pane, then click the Insert into Rule Text button on the toolbar, or chose that action from the context menu on the node.

4. Use the Validate button to validate the rule text.

The Validate button checks the validity of the syntax of your CDL statements, and checks the references in the rule text to model structure. If the rule is invalid or has an error, that's indicated in the Status indicator for the rule on its Details region.

You can leave a rule in Invalid status if necessary. Invalid rules are ignored when testing the model.

5. Check the Status indicator

The Status indicator shows whether the rule has been modified, and whether it's valid or has an error. Error messages provide details about any problems with the rule.

6. Save the rule.

To test a rule, you must compile it, with the Save and Compile action. The Test Model action compiles the run for you.

If you're unable to create a valid rule, you can click Save to save the rule text in its current state, to work on later. The invalid rule will be ignored when testing.

Testing a Configurator Rule

To verify that the behavior of a configurator rule is what you expect, test the model.

To test a configurator rule:

  1. Click the Test Model button. You don't have to be on the Rules tab of the model to test rules.

  2. In the Test Model dialog box, ensure that you select a user interface that includes nodes of the model that are affected by the rule behavior that you intend to test, in the User Interface field. By default, the previously tested UI is selected.

  3. Make selections among the configuration options, emulating both the likely and also the possible choices made by an end user. Navigate through the pages of the UI, and observe how your own selections affect other selections that are made by the rule you're defining.