|
|||||||||
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 |
assertObject(java.lang.Object object)
Asserts an object, notice that it does not return the FactHandle |
void |
assertObject(java.lang.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. |
java.util.List |
getObjects()
|
java.util.List |
getObjects(java.lang.Class objectClass)
Retruns a List of Objects that match the given Class in the paremeter. |
java.lang.String |
getRuleName()
|
void |
modifyObject(java.lang.Object object)
Modifies an object. |
void |
modifyObject(java.lang.Object oldObject,
java.lang.Object newObject)
Modifies an object by looking up the handle of the oldObject and replacing the oldObject with the newObject for the FactHandle. |
void |
retractObject(java.lang.Object object)
Retracts an object from the WorkingMemory. |
Method Detail |
---|
void assertObject(java.lang.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(java.lang.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 modifyObject(java.lang.Object object) throws FactException
object
- -
the object to be modified
FactException
- -
Exceptions can be thrown by conditions which are wrapped and
returned as a FactExceptionvoid modifyObject(java.lang.Object oldObject, java.lang.Object newObject) throws FactException
oldObject
- -
The old object to be modifiednewObject
- -
the new modified object
FactException
void retractObject(java.lang.Object object) throws FactException
object
- -
the object to be retracted.
FactException
- -
Wraps and returns any exception that may occur.java.lang.String getRuleName()
java.util.List getObjects()
java.util.List getObjects(java.lang.Class objectClass)
objectClass
- -
The Class to filter by
void clearAgenda()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |