Die Rule-Engine stellt die Basis-Technologien für die regelbasierte Verarbeitung einiger Komponenten bereit.
Diese wird unter anderem von der Rewrite-Komponente und der Transformations-Komponente verwendet.

Components and semantics

The Rule-Engine has several components

Working Memory

The working memory exists of all objects that have to be processed by rules. For the transformation, for example, the working memory consists of all logical operators that should be transformed by rules into their physical counterpart.

To interact with the working memory in a rule, there are the following methods:

Important is the retract method. If an object is never removed from the working memory by using retract, although there are rules, it may be possible to get into an infinity loop!

 

Inventory

The inventory consits of all necessary objects for the current rule engine instance. This is, normally, the set of all rules and the RuleFlowGroups (see below).

Each time when the rule engine is invoked, the rule engine creates a copy of the inventory. This is needed so that rules can not be changed if they are in use. Furthermore, it allows nested runs of the rule engine, e.g. to run a transformation within another transformation without influecing each other.

The rule engine consists of a two-stage hierarchy: First, there is a list of RuleFlowGroups and, secondly, each RuleFlowGroup has a set of Rules.

RuleFlowGroup

Die Rule-Engine ermöglicht es Gruppen zu definieren, die als RuleFlowGroup bezeichnet werden. Jede Regel wird einer dieser Gruppen zugeordnet.
Die Engine führt dann jede Gruppe hintereinander aus. Aus diesem Grund gibt es eine feste Ordnung aller Gruppe. Dabei darf jedoch eine Gruppe mehrmals innerhalb dieser Liste vorkommen.

Bei der Ausführung einer RuleFlowGroup wird jede Regel innerhalb einer Gruppe getestet, ob sie ausgeführt werden kann. Dabei gibt es folgende zwei Möglichkeiten:

Rules

Jede Regel ist einer RuleFlowGroup zugeordnet.
Bei einem Durchlauf der RuleFlowGroup wird folgendes für jede Regel in der RuleFlowGroup gemacht: