Execution properties for rule tasks
You specify the rule task execution properties in the Rule Task tab of the Properties view to control rule execution in different execution modes. You can choose a rule engine algorithm to run the rules in a particular rule task, and use execution control properties to further refine the number and order of rules the rule engine should run.
In general, the order of the rule artifacts in the list of selected rules is not guaranteed, and the list of selected rules is considered as a pool of rules to be run. However, with Ordering set to Literal, the order of the rule artifacts selected becomes important.
Action | Location | Description |
---|---|---|
Rule selection | Rule Selection tab in Properties view for rule task. | Click Edit to add and change the order of rules and rule packages by using the Select Rules dialog. |
Runtime rule selection | Dynamic BAL, Static BAL and IRL in the Rule Selection tab of the Properties view for rule task. | Control which rules are evaluated in a rule task. |
Execution mode | Rule Task tab in Properties view for rule task. | Specifies an execution mode for the rule task. |
Rule task ordering | Rule Selection tab in Properties view for rule task. | The default ordering of a rule task:
|
Rule task exit criteria | Rule Task tab in Properties view for rule task. | Choose exit criteria specifies how rules are run before the task terminates. See Exit criteria property for details. |
Control properties for rule tasks in execution modes
You can set specific properties to order rule tasks. These settings operate differently in each execution mode: RetePlus, Sequential, and Fastpath.
The following table outlines how ruleflow control properties operate in RetePlus execution mode.
Ordering property | Exit Criteria property | Advanced Properties only |
---|---|---|
Default A RetePlus network with full agenda management is created. |
None All the rules in the task body are activated. Rule instances are run until the agenda is empty. Equivalent to:
|
firinglimit > 0 : instances are run until either the given
number is reached or the agenda is empty. |
RuleInstance Only the highest priority rule of the task body is activated. Just the first instance of the rule is run, or none if the agenda is empty. Equivalent to:
|
||
Deprecated feature:
Literal A RetePlus network is created but there is no agenda. Rules are activated one by one according to the order provided by the body, and the instances are run without reevaluation. Or: Priority A RetePlus network is created but there is no agenda. Rules are first sorted in decreasing order of priority. They are then activated one by one and the instances run without reevaluation. |
None A loop is made on each of the rules provided in the task body, their instances computed and run. Instances are run until the end of the loop. Equivalent to:
|
firinglimit > 0 : rule instances are run
until either the given number or the end of the loop is reached. |
Rule A loop is made on each rule provided in the task body. As soon as a rule can be instantiated (that is, at least one rule instance is created), all those instances are run and the loop ends. Equivalent to:
|
||
RuleInstance A loop is made on each rule provided in the task body. As soon as a rule can be instantiated (that is, at least one rule instance is created) that instance is run and the loop ends. Equivalent to: |
The following table outlines how ruleflow properties operate in sequential execution mode.
Ordering property | Exit Criteria property | Advanced Properties only |
---|---|---|
Default In the sequential mode, the Default property acts the same way as the Priority property. For decision tables, the rule execution order is top down. |
||
Literal Rules are compiled according to the order provided by the task body. Rules are evaluated and run sequentially against the incoming tuple objects. Or: Priority Rules are sorted according to their priorities. They are then compiled according to the sorted order. The rules are evaluated and run sequentially against the incoming tuple objects. |
None All the rules provided
in the task body are evaluated. All the rules evaluated as Equivalent to:
|
firinglimit > 0 : rules evaluated as true are
run until the given number of rules is reached, or there are
no more rules to select. |
Rule The rules provided in
the task body are evaluated sequentially. As soon as one rule evaluates
to Equivalent to:
This property forces
the |
Not applicable. |
|
RuleInstance The rules provided in the task body are evaluated. As soon as one rule can be instantiated (that is, one rule instance is created), that instance is run and the loop ends. Equivalent to:
|
The following table outlines how ruleflow properties operate in Fastpath execution mode.
Ordering property | Exit Criteria property | Advanced Properties only |
---|---|---|
Default In the Fastpath mode, the Default property acts the same way as the Priority property. |
||
Literal Rules are compiled according to the order provided by the task body. Rules are evaluated and run sequentially against the incoming tuple objects. Or: Priority Rules are sorted according to their priority. They are then compiled according to the sort order. The rules are evaluated and run sequentially against the incoming tuple objects. |
None All the rules provided
in the task body are evaluated. All the rules evaluated as Equivalent to:
|
firinglimit > 0 : rules evaluated
as true are run until the given number of rules
is reached, or there are no more rules to select. |
Rule The rules provided in the task body are evaluated. As soon as one rule can be instantiated (that is, one rule instance is created), those instances are run and the loop ends. Equivalent to:
|
||
RuleInstance The rules provided in the task body are evaluated. As soon as one rule can be instantiated (that is, one rule instance is created), that instance is run and the loop ends. Equivalent to:
|
Rule execution order
When the rule artifacts for a rule task are selected at compile time or run time, the packages in the list of selected rules are expanded. The expansion starts at the top of the list. If a business rule is listed separately above its package, it retains its execution position in the list.
- If you add R2 and then the package, the expanded list is R2, R1 and R3.
- If you add the package and then R2, the expanded list is R1, R3 and R2.
Exit criteria property
Exit
Criteria
property specifies whether all the rules run
or just the first instance of the first rule runs. You can set
the property to one of the following values:- None: All the instances of all the applicable rules run for a tuple before moving to the next tuple.
- Rule: All the rule instances of the first applicable rule run for a tuple before moving to the next tuple.
- Rule Instance: Only the first rule instance of the first applicable rule runs for a tuple before moving to the next tuple.