|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface KnowledgeHelper
KnowledgeHelper implementation types are injected into consequenses instrumented at compile time and instances passed at runtime. It provides convenience methods for users to interact with the WorkingMemory.
Of particular interest is the modifyObject method as it allows an object to be modified without having to specify the facthandle, because they are not passed to the consequence at runtime. To achieve this the implementation will need to lookup the fact handle of the object form the WorkingMemory.
Method Summary | |
---|---|
void |
assertLogicalObject(Object object)
|
void |
assertLogicalObject(Object object,
boolean dynamic)
|
void |
assertObject(Object object)
Asserts an object, notice that it does not return the FactHandle |
void |
assertObject(Object object,
boolean dynamic)
Asserts an object specifying that it implement the onPropertyChange listener, notice that it does not return the FactHandle. |
void |
clearAgenda()
Clears the agenda causing all existing Activations to fire ActivationCancelled events. |
void |
clearAgendaGroup(String group)
|
Object |
get(Declaration declaration)
|
Activation |
getActivation()
|
Declaration |
getDeclaration(String identifier)
|
AgendaGroup |
getFocus()
|
List |
getObjects()
|
List |
getObjects(Class objectClass)
Retruns a List of Objects that match the given Class in the paremeter. |
QueryResults |
getQueryResults(String query)
|
Rule |
getRule()
|
Tuple |
getTuple()
|
WorkingMemory |
getWorkingMemory()
|
void |
modifyObject(FactHandle handle,
Object newObject)
|
void |
retractObject(FactHandle handle)
|
void |
setFocus(AgendaGroup focus)
|
void |
setFocus(String focus)
|
Method Detail |
---|
void assertObject(Object object) throws FactException
object
- -
the object to be asserted
FactException
- -
Exceptions can be thrown by conditions which are wrapped and
returned as a FactExceptionvoid assertObject(Object object, boolean dynamic) throws FactException
object
- -
the object to be asserteddynamic
- -
specifies the object implements onPropertyChangeListener
FactException
- -
Exceptions can be thrown by conditions which are wrapped and
returned as a FactExceptionvoid assertLogicalObject(Object object) throws FactException
FactException
void assertLogicalObject(Object object, boolean dynamic) throws FactException
FactException
void modifyObject(FactHandle handle, Object newObject) throws FactException
FactException
void retractObject(FactHandle handle) throws FactException
FactException
Object get(Declaration declaration)
Rule getRule()
Tuple getTuple()
Activation getActivation()
WorkingMemory getWorkingMemory()
List getObjects()
List getObjects(Class objectClass)
objectClass
- -
The Class to filter by
QueryResults getQueryResults(String query)
void clearAgenda()
void clearAgendaGroup(String group)
AgendaGroup getFocus()
void setFocus(String focus)
void setFocus(AgendaGroup focus)
Declaration getDeclaration(String identifier)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |