Sequential mode

The sequential mode executes all the eligible rules for a given rule task in sequence, which provides specific performance advantages.

The following diagram shows how the sequential algorithm works.

Diagram of the rule engine in sequential mode

The sequential algorithm operates as follows:

  1. The rule engine performs pattern matching on input ruleset parameters and on the conditions defined on the collections of objects in working memory.

  2. For each match, a rule instance is created and immediately executed. When a rule instance is executed, it sets the value of an attribute or an output ruleset parameter.

Rules that are executed with the sequential algorithm are stateless. The sequential algorithm operates rather like an execution stack where pattern–matching rule instances are executed once with no re-evaluation of the rules. In rules that are executed in sequential mode, you cannot use existence conditions, such as there is at least one, or the number of, in relation to objects in the working memory. However, you can make such conditions refer to a collection within an object in the working memory, see in.

Because of its systematic nature, the sequential execution mode performs particularly well on validation and compliance types of applications.

Rules can be processed sequentially using rule tasks within a ruleflow, see Ruleflows.

Sequential processing is specified in the algorithm property of the rule task. You can select it explicitly in Rule Designer. See Choosing an execution mode.