Setting simple priorities among rules
Rules have priorities, which can be static or dynamic. Use a constant to define a static priority, or an expression containing a ruleset variable to define a dynamic priority.
Static priority
Use a static
priority to change the sequence of rule execution among rules.
Static priorities are integers, the relative values of which determine the priorities among the
rules. You can also use a static
priority to change the order of execution between
several instances of the same rule when they are eligible for execution at the same time.
You define static priorities by using a constant. In the Value field of the priority property, you type a number that represents the priority. The number can be any Java™ integer value between -109 and +109 . The larger the number, the higher the execution priority of the rule.
Dynamic priority
dynamic
priority is an expression whose value depends on ruleset variables
bound in the condition part of a rule.In the Value field of the priority property, you enter an expression that uses a ruleset variable. The expression can use any variables defined in the condition part of the rule provided that its scope is for the entire ruleset. If the expression returns a number that is not an integer, it is converted to an integer following the Java language specification.
-
prior1 + ?p
-
-?a
Constants
You can use constants in rule priorities. These priority values are integers that are written as a literal or an expression that has an integer value.
The following list shows the constants for setting priorities on rules:
maximum
: The highest priority, its value is one billion.high
: The second highest priority, its value is one million.low
: The second lowest priority, its value is minus one million.minimum
: The lowest priority, its value is minus one billion.