|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WorkingMemory
A knowledge session for a RuleBase
.
While this object can be serialised out, it cannot be serialised in. This is because
the RuleBase reference is transient. Please see the RuleBase interface for serializing
in WorkingMemories from an InputStream.
Method Summary | |
---|---|
void |
addEventListener(AgendaEventListener listener)
Add an event listener. |
void |
addEventListener(WorkingMemoryEventListener listener)
Add an event listener. |
FactHandle |
assertObject(Object object)
Assert a fact. |
FactHandle |
assertObject(Object object,
boolean dynamic)
Assert a fact registering JavaBean PropertyChangeListeners
on the Object to automatically trigger modifyObject calls
if dynamic is true . |
void |
clearAgenda()
Clear the Agenda |
void |
clearAgendaGroup(String group)
Clear the Agenda Group |
void |
fireAllRules()
Fire all items on the agenda until empty. |
void |
fireAllRules(AgendaFilter agendaFilter)
Fire all items on the agenda until empty, using the given AgendaFiler |
Agenda |
getAgenda()
|
List |
getAgendaEventListeners()
Returns all event listeners. |
FactHandle |
getFactHandle(Object object)
Retrieve the FactHandle associated with an Object. |
AgendaGroup |
getFocus()
|
Object |
getGlobal(String name)
Retrieve a specific piece of global data by name |
Map |
getGlobals()
Retrieve all of the set application data in this memory |
Object |
getObject(FactHandle handle)
Retrieve the object associated with a FactHandle . |
QueryResults |
getQueryResults(String query)
Retrieve the QueryResults of the specified query. |
RuleBase |
getRuleBase()
Retrieve the RuleBase of this working memory. |
List |
getWorkingMemoryEventListeners()
Returns all event listeners. |
Iterator |
iterateFactHandles()
|
Iterator |
iterateFactHandles(ObjectFilter filter)
|
Iterator |
iterateObjects()
|
Iterator |
iterateObjects(ObjectFilter filter)
|
void |
modifyObject(FactHandle handle,
Object object)
Modify a fact. |
void |
removeEventListener(AgendaEventListener listener)
Remove an event listener. |
void |
removeEventListener(WorkingMemoryEventListener listener)
Remove an event listener. |
void |
retractObject(FactHandle handle)
Retract a fact. |
void |
setAsyncExceptionHandler(AsyncExceptionHandler handler)
Sets the AsyncExceptionHandler to handle exceptions thrown by the Agenda Scheduler used for duration rules. |
void |
setFocus(AgendaGroup focus)
|
void |
setFocus(String focus)
|
void |
setGlobal(String name,
Object value)
Set a specific piece of global in this working memory. |
void |
setGlobalResolver(GlobalResolver globalResolver)
Delegate used to resolve any global names not found in the global map. |
IProcessInstance |
startProcess(String processId)
Starts a new process instance for the process with the given id. |
Method Detail |
---|
void addEventListener(WorkingMemoryEventListener listener)
listener
- The listener to add.void removeEventListener(WorkingMemoryEventListener listener)
listener
- The listener to remove.List getWorkingMemoryEventListeners()
void addEventListener(AgendaEventListener listener)
listener
- The listener to add.void removeEventListener(AgendaEventListener listener)
listener
- The listener to remove.List getAgendaEventListeners()
Agenda getAgenda()
Map getGlobals()
void setGlobal(String name, Object value)
name
- the name under which to populate the datavalue
- the global value, cannot be nullObject getGlobal(String name)
void setGlobalResolver(GlobalResolver globalResolver)
globalResolver
- RuleBase getRuleBase()
RuleBase
of this working memory.
RuleBase
.void fireAllRules() throws FactException
FactException
- If an error occurs.void fireAllRules(AgendaFilter agendaFilter) throws FactException
FactException
- If an error occurs.Object getObject(FactHandle handle) throws NoSuchFactObjectException
FactHandle
.
handle
- The fact handle.
NoSuchFactObjectException
- If no object is known to be associated with the specified
handle.#containsObject
FactHandle getFactHandle(Object object) throws NoSuchFactHandleException
FactHandle
associated with an Object.
object
- The object.
NoSuchFactHandleException
- If no handle is known to be associated with the specified
object.#containsObject
Iterator iterateObjects()
Iterator iterateObjects(ObjectFilter filter)
Iterator iterateFactHandles()
Iterator iterateFactHandles(ObjectFilter filter)
AgendaGroup getFocus()
void setFocus(String focus)
void setFocus(AgendaGroup focus)
FactHandle assertObject(Object object) throws FactException
object
- The fact object.
FactException
- If an error occurs.QueryResults getQueryResults(String query)
query
- The name of the query.
IllegalArgumentException
- if no query named "query" is found in the rulebaseFactHandle assertObject(Object object, boolean dynamic) throws FactException
PropertyChangeListeners
on the Object to automatically trigger modifyObject
calls
if dynamic
is true
.
object
- The fact object.dynamic
- true if Drools should add JavaBean
PropertyChangeListeners
to the object.
FactException
- If an error occurs.void retractObject(FactHandle handle) throws FactException
handle
- The fact-handle associated with the fact to retract.
FactException
- If an error occurs.void modifyObject(FactHandle handle, Object object) throws FactException
handle
- The fact-handle associated with the fact to modify.object
- The new value of the fact.
FactException
- If an error occurs.void setAsyncExceptionHandler(AsyncExceptionHandler handler)
handler
- void clearAgenda()
void clearAgendaGroup(String group)
IProcessInstance startProcess(String processId)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |