The Add Constraint Knowledge Tool creates constraint knowledge objects. These can be in the form of trees, tables or procedures. Often a knowledge base will contain many of these constraint knowledge objects which interact to form a constraint domain.
This constraint knowledge when used with Dialog objects restricts the values of objects on the XpertForm view so that only the valid combinations are selectable.
When using the Add Constraint Knowledge build tool, the resulting object is placed in the object catalog, the user can then open this object to edit it.
The four different options are:
Constraint trees are built using various objects and the outcomes of the tree are valid or invalid. Constraints
This is the same with Decision tables, every variation can be given and the outcome of the table can be valid or invalid.
When there are many columns, building a truth table isn't viable so example rows are set that are valid or invalid to produce the knowledge.
On both types of table an induced decision tree can be automatically generated.
Multiple constraints trees are combined automatically if they share objects
Constraint procedures are JavaScript script objects that programmatically define constraint relationships between question objects.
They can be created by using the ‘Add Constraint Knowledge’ build tool or by taking an existing JavaScript script object and selecting question objects from the ‘Constraints’ menu on the right-hand side of the script editor.
A Constraint procedure is indicated in the Decision Map and the Object Catalog by a blue marker to the right of the procedure’s name.
A constraint procedure must include the return statement, where false returned indicates the constraints are violated and true returned indicates that the constraints are satisfied.
While a normal procedure is invoked either with a Do statement or from a decision tree, a constraint procedure cycle is invoked automatically from the XpertForm Dialog. This is done whenever the value of a dialog control tied to a constrained object changes (and for initial dialog set-up). For example, for a list type question this is done when a value is selected or deselected. For a numeric type question this is done when the focus is moved away from the dialog control (e.g. the tab key is pressed).
When the value of a dialog control tied to a constrained object changes, for each constrained object on the dialog and then for each other object constrained with it:
Execute the constraint procedure n times