|
Rule Execution Server API | ||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
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 |
Rule engine runtime API.
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);
|
Rule Execution Server API | ||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |