| Interface | Description |
|---|---|
| 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 | |
| CustomExceptionHandler |
CustomExceptionHandler is an interface to implement and to declare
to provide a custom exception handling. |
| ExceptionHandler | Deprecated
As of ODM 8.8.1, the interface
CustomExceptionHandler should be used to write a custom exception handler |
| 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 | Description |
|---|---|
| Rule.Kind |
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.
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 ) {
...
}
Rule instance.
Use Rule to obtain information about a particular rule. It is
always attached to an RuleEngineDefinition object.
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);
© Copyright IBM Corp. 1987, 2017