This chapter covers the following topics:
Logic Rules enable you to express constraints among elements of your Model in terms of logical relationships. For example, selecting one Option A may require that Options B and C be included in the configuration.
When defining a Logic Rule, you specify the rule’s behavior by selecting a logic relation. Oracle Configurator Developer provides the following logic relations:
The following sections describe each type of relation and present tables illustrating their behavior. In each table, the unshaded portion indicates the logic state the option has after an end user selects it, and the shaded portion indicates the logic state of the option on the other side of the rule that results from the selection. The arrows indicate the direction in which the rule propagates.
Notice that a rule can propagate from Operand 1 to Operand 2 of the relation, or from Operand 2 to Operand 1. Notice also that for some values and some logic relations the rule does not propagate; therefore logic state of the option on the other side of the rule does not change.
Note: In this chapter, "true" and "false" are used generally to indicate only whether an option is included or excluded from the configuration. Therefore, the examples in the following sections do not differentiate between User True and Logic True, and User False and Logic False. For details about how the runtime Oracle Configurator uses logic state to display options, see Selection State.
The effect of the Implies relation:
If the end user selects Option A it becomes true and Option B is also selected. In other words, Option B’s logic state becomes true.
See The Implies Relation.
Deselecting Option A causes Option B to become Unknown. In other words, Option B is available for selection.
If the end user selects Option B first, it becomes true and Option A becomes Unknown.
If the end user deselects Option B, both Option B and A become false.
The effect of the Excludes relation:
If the end user selects Option A, it becomes true and Option B becomes false. In other words, Option B is excluded from the configuration.
If the end user tries to select Option B, Oracle Configurator displays a contradiction message.
If the end user deselects Option A, Option B becomes Unknown. In other words, Option B is available for selection.
If the end user selects Option B first, Option A becomes false.
If the end user deselects Option B, then Option A becomes Unknown.
Logic rules that use the Requires relation "push both ways," which means that selecting an option on one side of the rule has the same effect on the option on the other side of the rule. See the examples below for details.
The effect of the Requires relation:
If the end user selects an option on one side of the rule, the option on the other side of the rule is also selected. The same is true when the end user deselects an option.
In other words, both options must be either included in the configuration, or excluded from the configuration.
The Negates relation is similar to the Requires relation, in that it also "pushes both ways." However, the Negates relation prevents an option from being selected when an option on the other side of the rule is selected. In other words, selecting one option prevents the other option from being included in the configuration.
The effect of the Negates relation:
If the end user selects Option A, it becomes true and Option B is set to false.
See The Negates Relation.
If the end user then deselects Option A, it becomes false and Option B becomes true. In other words, Option B is selected.
If the end user selects Option B first, it becomes true and Option A becomes false.
If the end user then deselects Option B, Option A becomes true.
The effect of the Defaults relation: If the end user selects the Option A, it becomes true and Option B is also selected and becomes true.
Unlike other logic relations, the logic state of Option B is not enforced. An end user can set Option B to true or false (that is, select or deselect it), regardless of the state of Option A, and Oracle Configurator will not display a contradiction message. The relation’s only action is to set Option B to true when Option A is true.
If Option B is already true, the rule does not change the option’s state when Option A is selected. In other words, a Logic Rule that uses the Defaults relation only selects additional options when the end user, or the action of another rule, selects an option (or options).
A Defaults Logic Rule can be used to set up an initial configuration, for example, by triggering a set of Defaults relations with a Boolean Feature whose initial value is true.
For example, you define a Boolean Feature X with an Initial Value of True. You also define Feature Y which has three Options: A, B, and C. The Maximum Selections for Feature Y is 2. You then define the following Logic Rules:
Feature X Defaults Feature Y
Feature Y Defaults AllTrue (A, B)
At runtime, both Option A and B are selected, and have a logic state of Logic True. Because the Maximum Selections for Feature Y has been reached, Option C has a logic state of Logic False. If the end user deselects Option A, it becomes User False and Option B becomes Unknown (that is, it is no longer selected). To avoid this behavior, delete the second rule (Feature Y Defaults AllTrue (A, B)) and define the following rules:
Feature Y Defaults A
Feature Y Defaults B
Note: When multiple Default rules are evaluated and conflict with one another, it is inconclusive as to which rule succeeds. Using many Defaults Logic Rules can significantly affect runtime performance of a configuration model. For more information, see the Oracle Configurator Modeling Guide.
Compare and contrast the effects of the logical relationships as shown in Summary of Logical Relationships :
Summary of Logical Relationships
The preceding sections describe logical relationships in terms of true and false values for Operand 1 and Operand 2 (the two sides of the relation). You can also define logic relations where Operand 1 or Operand 2 involves an expression of more than one term; for example, all Options of a Feature. In this case, you must specify whether that side of the relation is true if all of the terms are true, or if that side is true if any of the terms are true.
Select the AllTrue condition when defining a Logic Rule (or use the AllTrue function when defining a Statement Rule) if you want the relation to evaluate to true only when all terms are true. The relation is false if any term is false. This is a logical AND expression.
Select the AnyTrue condition when defining a Logic Rule (or use the AnyTrue function when defining a Statement Rule) if you want the relation to evaluate to true if any term is true. The relation is false only when all terms are false. This is a logical OR expression.
Statement Rules are described in Overview of Statement Rules.