Deciding on an execution mode
You can choose a different execution mode than the default one and provide selection criteria.
Here is a brief table that shows which execution mode to select in what cases.
Choose this mode: | In this case: |
---|---|
RetePlus |
|
Sequential |
|
Fastpath (the default mode for ruleflow tasks as of Operational Decision Manager V8.6) |
|
To determine which execution mode to use on a rule task, you must analyze the structure of the rules in the rule task and what type of processing they perform.
You cannot use the Fastpath or Sequential algorithm when the rules have actions that create, modify, or remove objects that are matched in the conditions of the rules.
To make the best choice, answer the following questions:
What type of application do your rules implement?
Depending on the purpose of the business logic that is defined in a rule task, you choose a different execution mode.
- Compliance and validation
Loosely interrelated rules that check a set of conditions to yield a go/no go or similar constrained result. Compliance business rule applications are often used in underwriting, fraud detection, data validation, and form validation. Business rules in such applications generally have a yes or no result and provide some explanation on the decision.
For compliance applications, preferably use the sequential or Fastpath execution modes.
- Computation
Strongly interrelated rules that compute metrics for a complex object model. Computation business rule applications are often used for scoring and rating, contracts, and allocation. Business rules in such applications carry out different calculations on an object that is responsible for providing a final value (or rating).
For such applications, preferably use the RetePlus execution mode if inference is necessary, or use the Fastpath execution mode.
- Correlation
Strongly interrelated rules that correlate information from a set of objects to compute some complex metrics. Correlation business rule applications are often used for billing. Business rules in such applications insert information.
For correlation applications, preferably use the RetePlus execution mode if inference is necessary, or use the Fastpath execution mode.
- Stateful session
Strongly interrelated rules that correlate events in a stateful engine session. Stateful applications are often used in alarm filtering and correlation, GUI customization, and web page navigation.
For such applications, preferably use the RetePlus execution mode without a ruleflow.
What types of objects do your rules use?
Depending of the types of objects acted upon by your rules, you choose a different execution mode.
Homogeneous or heterogeneous rules?
Bindings are heterogeneous when rules do not operate on the same classes. When bindings are heterogeneous, the rules might have condition parts of different heights. For example:
Rule | Condition |
---|---|
Rule1 | ... when{A();B()} ... |
Rule2 | ... when{A()} ... |
Rule3 | ... when{B()} ... |
If your rules define heterogeneous bindings, use the RetePlus or Fastpath execution mode.
Bindings are homogeneous when all the rules operate on the same class (the same kind and number of objects), but introduce different tests, for example:
Rule | Condition |
---|---|
Rule1 | ... when{Person(age == 12);} ... |
Rule2 | ... when{Person(age > 20);} ... |
If your rules define homogeneous bindings, use the sequential execution mode.
What is the effect of rule actions?
Depending of the types of effects generated by your rules on execution, you choose a different execution mode.
- Modifications to the working memory
If rule actions manipulate working memory objects and use of the IRL keywords insert, retract, or update, use the RetePlus execution mode. Because these keywords entail modifications to the working memory, the rule engine reevaluates subsequent rules. If you use another execution mode, the rule engine does not reevaluate subsequent rules after the modifications.
- Rule chaining
When rule actions cause modifications in the working memory or in the parameters, and when they do pattern matching on objects that have no relationship, like people and hobbies, there is chaining between your rules. This process is also known as inference.
For example:
SILVER LEVEL CUSTOMER, GREATER THAN $5000 purchase promote to GOLD LEVEL GOLD LEVEL CUSTOMER, GREATER THAN $5000 purchase apply 25% discount
You can see there is chaining between these two rules because they do pattern matching on two different objects, customer and purchase, and that the second one modifies the level attribute of the customer object.
Basically, if you know your rule actions cause the execution of other rules, use the RetePlus execution mode.
What sort of tests do you find in rule conditions?
Depending on the type of conditions used in your rules, you choose a different execution mode.
- Tests that require a working memory
If rule conditions test the existence of an object or gather items of a collection directly in working memory, with the IRL keywords exists or collect, without in or from constructs, use the RetePlus or Fastpath execution modes.
- Regular pattern for tests
If the tests in rule conditions have the same pattern and order, such as the tests that are generated from decision tables, use the Fastpath execution mode.
If the order of tests in rule conditions is not regular, use the RetePlus or sequential execution modes.
What priorities have you set on your rules?
Depending on the priorities you have set on the rules, you choose a different execution mode.
If you have set static priorities, you can use any algorithm.
If you set dynamic priorities, that is, priorities that are defined as an expression, you must use the RetePlus execution mode.
Summary
You can use the following table as a reference to make your decision when you choose an execution mode for a rule task. The number of stars indicates the degree of performance.
In the classic rule engine, you can use runtime rule selection with Fastpath. But if you do so and select only a few rules, you will not get good performance results because Fastpath is compiled against the task scope and therefore might evaluate conditions of rules that are filtered out by the dynamic select.
In your rule task: | RetePlus | Sequential | Fastpath |
---|---|---|---|
Compliance and validation application | |||
Computation application with inference | |||
Computation application without inference | |||
Correlation application with inference | |||
Correlation application without inference | |||
Working memory objects | |||
Rule chaining | |||
Tests on existence or collection items directly in working memory | |||
Shared test patterns | |||
Heterogeneous bindings | |||
Dynamic priorities | |||
Runtime rule selection that selects a few rules among many | Classic rule engine: Decision engine: |
||
Numerous rules |