Rule Execution Server API

Package com.ibm.rules.engine.ruledef.runtime

Rule engine runtime API.

See:
          Description

Interface Summary
Agenda Agenda provides information about the agenda during rule engine execution.
AgendaController You use an AgendaController instance to control the Agenda during RuleEngine execution.
AgendaController.Filter You use a Filter instance to filter Rule objects when they are posted into the Agenda.
AgendaController.Sorter You use a Sorter instance to organize the list of ruleInstance objects contained in an Agenda
AgendaObserver Use AgendaObserver to observe changes in an Agenda as it is used by an RuleEngine.
ExceptionHandler ExceptionHandler handles exceptions raised either during the evaluation of a rule condition or during the execution of the rule body.
FastpathEngine FastpathEngine represents a rule engine that uses an optimized sequential algorithm.
QueryObserver  
Rule A Rule instance includes the name, package, description and properties of a rule.
RuleAction RuleAction defines an action component in a Rule.
RuleEngine RuleEngine represents a rule engine instance.
RuleEngineDefinition Use RuleEngineDefinition to create RuleEngine instances and access Rule definitions.
RuleEngineInput Use RuleEngineInput to parameterize RuleEngine execution.
RuleEngineObserver Use RuleEngineObserve to observe events specific to a RuleEngine.
RuleEngineOutput A RuleEngineOutput instance is produced when a RuleEngine is executed.
RuleInstance An RuleInstance object is defined by the association between an RuleAction and the tuple that satisfies the condition part of a Rule.
SteppingRuleEngine A SteppingRuleEngine is a rule engine that can execute rules one by one.
SteppingRuleEngineObserver Use SteppingRuleEngineObserver to observe events created by a SteppingRuleEngine instance during rule execution.
 

Enum Summary
Rule.Kind  
 

Package com.ibm.rules.engine.ruledef.runtime Description

Rule engine runtime API.

Overview

A rule engine definition is similar to a Classic Rule Engine ruleset. Using an engine definition you:

The rule engine uses a working memory and an agenda for containing and manipulating application objects. The working memory contains references to the application objects, and the agenda lists and orders the rule instances that are eligible to be executed.

Executing a rule engine

The following example shows you how to create and execute a rule engine.
EngineLoader loader = new EngineLoader(file);
RuleEngineDefinition engineDefinition = (RuleEngineDefinition)loader.load();
RuleEngine ruleEngine = engineDefinition.createEngine();

// working memory building
Collection>Object< wm = new ArrayList>Object<();
wm.add( myObject1 );
...
wm.add( myObjectN);
RuleEngineInput input = ruleEngine.createRuleEngineInput();
input.setWorkingMemory( wm );

// set potential parameters
input.setParameter( "myParameter", myValue );

// execution
try {
    RuleEngineOutput output = ruleEngine.execute( input );
    System.out.println ( "The number of rules executed is " + output.getExecutedRuleInstanceCount() );
  } catch ( Exception e ) {
   ...
  }

Rules

A rule in IBM Decision Server is represented as an Rule instance. Use Rule to obtain information about a particular rule. It is always attached to an RuleEngineDefinition object.

Monitoring the Decision Engine

The monitoring capabilities of the Decision Engine include the functionality from the Classic Rule Engine. Monitoring in the Decision Engine is divided in several observer interfaces. These observer interfaces extend Observer. To monitor an engine execution, implement the interfaces for the events you want to observe. For example, if you want to observe the events related to the engine start and stop, and the rule instance execution, write an observer class (MyObserver) implementing both EngineObserver and RuleEngineObserver. The observer is then passed to the rule engine:
RuleEngine engine = engineDefinition.createEngine();
MyObserver observer = new MyObserver();
engine.addObserver(observer);
EngineOutput output = engine.execute(engineInput);


Rule Execution Server API

© Copyright IBM Corp. 1987, 2013