Rule engine object
The rule engine reads rules from a ruleset archive, evaluates rule conditions against application objects, and executes the rules for the objects that meet the conditions. You can maintain the rule engine independently from the business applications.
The rule engine has the following functions:
- Read rules dynamically at run time.
- Evaluate the rules against the application objects.
- Keep track of changes to application objects.
The rule engine is designed so that you can manage the business behavior separately from the core, code-based architecture of an application. As a consequence, you can modify it independently from the code as often as necessary. The rule engine operates on rules that are expressed in IRL. This language expresses business rules in a form that is directly translatable to rule engine execution.
Decision Server provides a set of architecture-independent class libraries that you can use to integrate the rule engine into any Java™ application without predefined architectural constraints. You can deploy the rule engine on a Java Standard Edition (Java SE) or Java Enterprise Edition (Java EE) platform.
You must provide the rule engine with rules, in the form of ruleset archives. Rulesets interact with a calling application through input and output parameters. The ruleset and the ruleset parameters are packaged, ready for execution, into the ruleset archive. The rule engine matches rule conditions with objects that are defined by the ruleset parameters.
Ruleset parameters and garbage collecting: when you create
an instance of an OUT parameter within a ruleset,
the object might be lost at the end of the processing when Rule
Execution Server calls
the method IlrContext.end. To avoid this loss,
create the object before calling the ruleset, and use an IN_OUT parameter,
so that another object has a reference and the output parameter is
not garbage-collected.
You can create a ruleflow to control the order in which rules are executed. A ruleflow organizes rules into a sequence of decisions by grouping the rules into rule tasks. Ruleset parameters transfer information from the application to the rule engine. After execution, the output parameters return the results back to the application.
The following diagram illustrates the instantiation of the rule engine. The ruleset is loaded into the rule engine, and the input parameters are passed to the rule engine. The working memory contains the referenced objects, and the agenda lists and orders the rule instances that are scheduled for execution.

The rule engine interacts with the application objects and the rules in the following way:
References to the application objects are added to the rule engine. Through the XOM, the rule engine accesses the application objects. The rule engine uses these references to monitor the application objects.
Note: In any rule, the engine accepts up to 20 object references, otherwise an error message is displayed. This corresponds to a rule with up to 20 conditions, excluding anyevaluateconditions.The conditions of all the rules that are contained in the ruleset archive are evaluated. If the conditions of a rule are met, the rule is eligible for execution.
The rule engine processes the rules that you provide. It evaluates the rules against the application objects and executes the rules when appropriate.
The selection of the rules and the order in which they are selected also depend on the execution mode. The default execution mode is Fastpath, but you can also select the RetePlus or sequential execution modes.