Overview: Rulesets and ruleflows

Rules and other artifacts are selected to become part of the executable ruleset. You create a ruleflow to control the order in which rules are executed. You can use rule overriding to refine the selection.

A ruleset is a stand-alone executable container that can be used by the rule engine. Rules related to a given business decision are organized and stored in a ruleset. Rulesets interact with a calling application by means of input and output parameters. The ruleset and the ruleset parameters are packaged, ready for execution, into a ruleset archive.

Ruleflows are a key component of rule selection mechanisms. A rule is designed to make a decision but has no embedded notion of sequence or succession. A ruleflow organizes rules into a sequence of decisions by grouping the rules into rule tasks. The rule tasks are then organized into the sequence in which they should execute. A ruleflow is said to represent a business decision, which can be made up of a multitude of smaller decisions or rules. Ruleflows also specify the transitions from one task to the next: Transitions determine how, when, and under what conditions each task is executed.

The following diagram shows how rulesets and other artifacts are extracted from a rule project and packaged into a ruleset archive and how the increasing levels of refinement lead to the selection of the actual rule to be executed.

Diagram of rule extraction and packaging into a rule archive

The rules that are evaluated during ruleset execution are selected as follows:

  1. Ruleset extraction and ruleset archive generation

    Use ruleset extractors to filter which rules in the rule project are extracted into the a ruleset archive. Rule properties are typically used to filter unwanted rules. By removing unwanted rules during extraction, you can significantly reduce the size of the generated archive.

  2. Ruleflow scope selection

    Each rule task in a ruleflow has a scope, defined by a list of rule packages and individual rules. At run time, ruleflow scope selection generates a list of the rule packages and rules that you defined for each task. When a task is executed, only the rules within this scope are considered.

  3. Rule selection

    The runtime rule selection process further filters which rules to consider. Filtering is typically based on the value of rule properties and execution parameters.

  4. Rule overriding

    After all other selection mechanisms, you can specify that certain rules override other rules. The overridden rules are filtered out of the selection.

The previous selection processes result in a number of rules for evaluation. The conditions in those rules are evaluated and the rule actions are executed on the matching objects.