Rule Execution Server API

com.ibm.rules.engine.runtime
Interface RunningEngineWithWorkingMemory

All Superinterfaces:
EngineServices, RunningEngine
All Known Subinterfaces:
RunningRuleflowEngine, SteppingRuleEngine

public interface RunningEngineWithWorkingMemory
extends RunningEngine

Use the RunningEngineWithWorkingMemory interface only inside a RunningEngine. For example, in rules, tasks, or B2X


Method Summary
 Collection<Object> getWorkingMemory()
          Returns the working memory of the RuleEngine.
 void insert(Object o)
          Inserts an object into working memory.
 void retract(Object o)
          Removes an object from working memory.
 void retractAll()
          Removes all the objects from working memory.
 void update(Object o)
          Updates an object in working memory if the object has been asserted.
 void updateData()
          Updates the EngineData to ensure that the objects it references are consistent with the Agenda.
 void updateGenerator(Object generator)
          Updates a generator.
 void updateGenerators()
          Updates the generators.
 void updateGeneratorsElement(Object element)
          Updates a generator.
 
Methods inherited from interface com.ibm.rules.engine.runtime.RunningEngine
note, stop
 
Methods inherited from interface com.ibm.rules.engine.service.EngineServices
getNumberOfServices, getService, getServiceByName, getServiceClasses
 

Method Detail

getWorkingMemory

Collection<Object> getWorkingMemory()
Returns the working memory of the RuleEngine.

Returns:
The working memory.

insert

void insert(Object o)
            throws EngineExecutionException,
                   EngineInvalidStateException
Inserts an object into working memory. If o is already in working memory, a normal update is performed.

Throws:
EngineInvalidStateException - raised when the engine is set in the stop state
EngineExecutionException
Parameters:
o - The object to insert.

retract

void retract(Object o)
             throws EngineExecutionException,
                    EngineInvalidStateException
Removes an object from working memory.

Throws:
EngineInvalidStateException - when the Engine is set in the stop state.
EngineExecutionException
Parameters:
o - The object to remove.

retractAll

void retractAll()
                throws EngineExecutionException,
                       EngineInvalidStateException
Removes all the objects from working memory. The context and agenda are emptied.

Throws:
EngineInvalidStateException - when the Engine is set in the stop state.
EngineExecutionException

update

void update(Object o)
            throws EngineExecutionException,
                   EngineInvalidStateException
Updates an object in working memory if the object has been asserted. If a Rule that uses this object is true, a Rule instance is inserted into the Agenda and the Rule applies for as long as it can be fired.

Throws:
EngineExecutionException - raised when an exception occurs during a condition test evaluation or a rule action execution.
EngineInvalidStateException - raised when the engine is set in the stop state
Parameters:
o - The object to update.

updateGenerator

void updateGenerator(Object generator)
                     throws EngineExecutionException,
                            EngineInvalidStateException
Updates a generator. The generator referenced by generator are used in the in/from condition for a Rule .

Throws:
EngineExecutionException - when an exception occurs during condition test evaluation or RuleAction execution.
EngineInvalidStateException - when the Engine is set in the stop state.
Parameters:
generator - The object referencing a generator.

updateGeneratorsElement

void updateGeneratorsElement(Object element)
                             throws EngineExecutionException,
                                    EngineInvalidStateException
Updates a generator. The generator referenced by element is used in the in/from condition for a Rule .

Throws:
EngineExecutionException - when an exception occurs during condition test evaluation or RuleAction execution.
EngineInvalidStateException - when the Engine is set in the stop state.
Parameters:
element - The object referencing a generator.

updateGenerators

void updateGenerators()
                      throws EngineExecutionException,
                             EngineInvalidStateException
Updates the generators. The updated generators are used in the in/from condition for a Rule when a static method is called.

Throws:
EngineExecutionException - when an exception occurs during condition test evaluation or RuleAction execution.
EngineInvalidStateException - when the Engine is set in the stop state.

updateData

void updateData()
                throws EngineExecutionException,
                       EngineInvalidStateException
Updates the EngineData to ensure that the objects it references are consistent with the Agenda. If the Rule objects run by this Engine contain references to objects that are accessed using EngineData in the Rule instances, and if these objects have been modified, call this method to ensure that the Agenda is in a consistent state with the objects referenced by the EngineData.

Throws:
EngineExecutionException - raised when an exception occurs during a condition test evaluation or a rule action execution.
EngineInvalidStateException - raised when the engine is set in the stop state

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013