Execution properties for rule tasks

You can define rule task execution properties to select the rule engine algorithm that is used to run the rules, and refine the number and order of rules that the rule engine runs.

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.

Table 1. Control settings for rule tasks
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:
  • Default the ordering of rules depends on the execution mode.

  • Literal follows the rule task ordering.

  • Priority sorts rules according to the execution mode in operation.

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.

Table 2. Task ordering properties for RetePlus
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:

firing=allrules, firinglimit=0

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:

firing=rule, firinglimit=1

Deprecated feature:

Deprecation icon RetePlus literal, sorted, and priority ordering modes are deprecated in V8.6. These features will be removed in a future release. See Deprecated features for migration details.

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:

firing=allrules, firinglimit=0

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:

firing=rule, firinglimit=0

 

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:

firing=rule, firinglimit=1

 

The following table outlines how ruleflow properties operate in sequential execution mode.

Table 3. Task ordering properties for Sequential
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 true are run until there are no more rules to select. The order is the one determined by the ordering property.

Equivalent to:

firing=allrules, firinglimit=0

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 true, it is run and the loop ends.

Equivalent to:

firing=rule

This property forces the firinglimit to 1.

firinglimit

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:

firing=rule, firinglimit=1

The following table outlines how ruleflow properties operate in Fastpath execution mode.

Table 4. Task ordering properties for Fastpath
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 true are run until there are no more rules to select. The order is determined by the ordering property.

Equivalent to:

firing=allrules, firinglimit=0

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:

firing=rule, firinglimit=0

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:

firing=rule, firinglimit=1

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.

For example, consider a package that contains rules R1, R2 and R3:
  • 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

The 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.