Rule task execution modes define the rule engine algorithm that is used to execute the rules. Control properties further refine the number and order in which the rule engine executes rules, depending on the execution mode.
You can choose a rule execution mode to execute the rules in a particular rule task with a rule engine algorithm that corresponds to your chosen mode. You can use execution control properties to refine further the number and order of rules that the rule engine executes.
You set the execution mode, and the ordering and exit criteria as rule task properties in the Selection Properties pane.
Rule execution modes and control properties are technical features of the ruleflow. For more information about these features, refer to the Rule Designer user documentation.
You can choose between three execution modes to operate the rule engine. The execution mode determines which rules to execute and in which sequence.
You can select an execution mode for each rule task in a ruleflow. By default, a rule task uses the RetePlus execution mode. To achieve optimal performance, you can choose another execution mode that is better suited to the rules in a particular rule task.
You can set the Execution Mode property of a rule task to one of the following values:
RetePlus: The default mode, RetePlus is optimal for pattern matching and rule chaining, and when many objects are evaluated.
Sequential: This mode is optimal when you have many rules but few objects.
Fastpath: This mode is optimal when you have rules that implement a decision structure and many objects. It might be longer than the sequential mode at compilation time, but it is faster at run time.
Selected rules do not necessarily execute in the order in which the rule task lists them. The rule execution mode you chose determines the order. With the Ordering property, you can define an execution order for your rules.
You can set the Ordering property of a rule task to one of the following values:
Default: the execution process applies the ordering scheme associated with the execution mode:
RetePlus: uses the ordering scheme of the RetePlus algorithm.
Sequential: executes rules as listed in the Rule Selection Editor.
Fastpath: executes rules as listed in the Rule Selection Editor.
Literal: The rules execute as listed in the Rule Selection Editor.
Priority: The rules execute according to their priorities, which are set in the Priority property of the rules.
The packages in the list of selected rules expand when the business rules for the rule task are evaluated at compilation time. 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. However, if it is listed separately below its package, the business rule executes from the package. Under the package, the business rule is redundant because it is already in the package.
For example, consider a package that contains rules R1, R2 andR3:
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, R2 and R3.
To force R2 to be last in the list, you must list the rules separately: R1, R3, and then R2.
The Exit Criteria property specifies whether all the rules execute or just the first instance of the first rule executes. You can set the rule task Exit Criteria property to one of the following values:
None: All the instances of all the applicable rules execute for a tuple before moving to the next tuple.
Rule: All the rule instances of the first applicable rule execute for a tuple before moving to the next tuple.
Rule Instance: Only the first rule instance of the first applicable rule executes for a tuple before moving to the next tuple.