Rule Builder > Managing Decision Trees > Decision Node Editing Operations > Editing a Decision Node |
Editing a Decision Node |
PREVIOUS NEXT |
To edit a decision node, do one of the following:
The Decision Node Editor opens as shown in Figure 13.11. The value in the Title field is augmented by one letter each time you add a new decision node.
This section has the following subsections:
The Title text field allows you to specify a title for the decision node.
To edit the decision node title:
If the label
property is defined for the first BOM element selected using the Rule Editor, it is used to assign a value to the Title field. This title can still be changed. Note that this assignment occurs only once when first selecting an expression on an empty decision node.
To be valid, a decision node must be assigned a decision test. This decision test is made of an expression, for example, the age of customer1
, and a predicate, for example, is between
. A predicate is a BOM method, either predefined or user defined, that returns a Boolean value.
You can build the decision test with the Decision Node Editor, using the parts of the BAL rule language that concern decision tests, according to the BOM assigned to the current library. An example is shown in Figure 13.13.
Once an expression is selected, you can select a predicate according to the type of the expression. An example is shown in Figure 13.14.
Together the expression and the selected predicate constitute a decision test.
For example, if the first test link is 0 - 10
, the full decision test will be:
if the age of customer is between 0 and 10
Depending on the Binding Mode of the class involved in the decision test, you may need to select an existing variable or create a new variable for the selected object. All variables declared in previous decision nodes and in preconditions are available in the Decision Node Editor.
You can select a static predicate or a user-defined predicate. A user-defined predicate is a method that returns a Boolean value on a nonprimitive type.
is
predicate is automatically set to compare the value of the member you selected and has a true
/false
value.
the age of customer is between <min> and <max>
, min
and max
will define the interval of a test link belonging to the decision node Age
. The max
and min
values of the interval are displayed in the tree next to the test link to which they belong, see [31, 40]
in Figure 13.15.Note |
The predicate assigned to the first test link of this decision node is used as the default for all subsequent test links belonging to this node. However, the value of the last test link can be overridden. |
If something is missing in the decision test (a variable, for instance), an error is displayed in the Decision Node Editor when validating the expression, as shown in Figure 13.16.
Decision Table / Tree Predicates | Decision Table / Tree Supported Data Types | Decision Tree Operations | Editing Preconditions | Editing the Operator of a Test Link
Customer Support | Copyright © 1987-2004 ILOG S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |