Choosing an execution mode
By default, a rule task node is assigned the Fastpath execution mode when you create it. To achieve optimal performance, you might need to choose another execution mode that is better adapted for the rules in a particular rule task node.
To determine which execution mode to use on a rule task node, you must analyze the structure of the rules in the rule task node and what type of processing they do.
What type of application do your rules implement?
Depending on the purpose of the business logic that is defined in a rule task node, you choose a different execution mode.
- Compliance and validation
-
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
-
Computation business rule applications are often used for scoring and rating, contracts, and allocation. Business rules in such applications carry out different calculations on data 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
-
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
-
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 sort of test do you use 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 in the working use the RetePlus or Fastpath execution modes.
You may use the Sequential execution mode when using the working memory if the rule conditions are homogeneous. You can read more about homogeneous rules in the What data types do your rules use? section below.
- 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.
What data types do your rules use?
Depending on the data types acted upon by your rules, you choose a different execution mode.
- Homogeneous or heterogeneous rules?
-
Bindings are heterogeneous when rules operate on different data types or on the same data types in different order.
Rule Condition Rule 1 definitions set 'a customer' to a Customer; set 'a shopping cart' to a Shopping cart;Rule 2 definitions set 'a customer' to a Customer;Rule 3 definitions set 'a customer' to a Customer; set ' a car' to a Car;Rule 4 definitions set 'a shopping cart' to a Shopping cart; set 'a customer' to a Customer;- Rule 1 and rule 2 are heterogeneous: they do not have the same number of bindings.
- Rule 1 and rule 3 are heterogeneous: they have the same number of bindings, but operate on different data types.
- Rule 1 and rule 4 are heterogeneous: they operate on the same data types, but in a different order.
If your rules define heterogeneous bindings, use the RetePlus or Fastpath execution modes.
For two rules to be homogeneous, both must begin with the same
definitionspart.
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.
- 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:
Rule 1 if the category of 'the customer' is Silver and the amount of 'the shopping cart' is greater than 5000 then promote 'the customer' to Gold ;Rule 2 if the category of 'the customer' is Gold then set 'the discount' to 25 ;You can see there is chaining between these two rules because the first rule modifies an object, the customer, that is used in the second rule. The second rule may be executed after the first one.
Basically, if you know your rule actions cause the execution of other rules, 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 node. The number of stars indicates the degree of performance.
| In your rule task node: | Fastpath | Sequential | RetePlus |
|---|---|---|---|
| Compliance and validation application | ★★★ | ★★★ | ★ |
| Computation application with rule chaining | ⦸ | ⦸ | ★★★ |
| Computation application without rule chaining | ★★★ | ★ | ★ |
| Correlation application with rule chaining | ⦸ | ⦸ | ★★★ |
| Correlation application without rule chaining | ★★★ | ★ | ★ |
| Rule chaining | ⦸ | ⦸ | ★★★ |
| Tests on existence | ★★★ | ⦸ | ★★★ |
| Shared test patterns | ★★★ | ★ | ★★ |
| Heterogeneous bindings | ★★★ | ⦸ | ★★★ |
| Runtime rule selection that selects a few rules among many | ★★ | ★★★ | ★★★ |
| Numerous rules | ★★★ | ★★★ | ★ |