RetePlus mode

Use RetePlus optimization techniques to improve performance through reduction of the number of rules and conditions, computation of the rules to run, and prioritization of the rule order.

In RetePlus mode, the rule engine minimizes the number of rules and conditions to be evaluated, computes which rules must be run, and identifies in which order these rules must be run. In RetePlus, the rule engine uses a working memory and an agenda for storing and manipulating application objects. The working memory contains references to the application objects. The agenda lists and orders the rule instances that are eligible to be run.

The following diagram shows how the RetePlus algorithm works.

Diagram of the rule engine in RetePlus mode

The RetePlus algorithm operates as follows:

  1. The rule engine matches the conditions of the rules in the ruleset against the objects in working memory. During the pattern matching process, RetePlus creates a network based on semantic relationships between rule condition tests.

  2. For each match, a rule instance is created and put into the agenda. Then, based on some ordering principles, the agenda selects the rule instance to be run.

  3. When the rule instance is run, the rule action is run.

    This action modifies the working memory in the following way
    • By adding an object to the working memory

    • By removing an object from the working memory

    • By modifying the attributes of an existing object.

  4. The process carries on cyclically until no more rule instances are left in the agenda.

In RetePlus, whenever the working memory is modified, the rule engine repeats the pattern matching process. It reassesses matches after each rule instance is run and modifies the data. As a possible consequence, the list of rule instances in the agenda can change. Thus, RetePlus is incremental and data-driven. The RetePlus algorithm is based on an inference process that the sequential and FastPath algorithms do not support.
Note:

Reteplus for the decision engine considers the value instead of the reference to identify rule instances. For example, a list that includes several strings with the same value does not activate one rule fired for each list instance, as is the case with the classic rule engine.