- All Known Subinterfaces:
RhsContext,RuleSession<S>,StatefulSession,StatelessSession
- All Known Implementing Classes:
AbstractSessionWrapper
-
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(FactHandle handle) Deletes a fact from the working memory.default FactHandleInserts a fact in working memory and returns a serializable fact handle.Inserts a fact in working memory and returns a serializable fact handle.Inserts a fact and explicitly specifies itsTypename.default FactHandleInserts a fact and explicitly specifies itsTypename.voidupdate(FactHandle handle, Object newValue) Updates a fact that already exists in the working memory
-
Method Details
-
insert
Inserts a fact in working memory and returns a serializable fact handle. The engine will derive the fact's logical type from its Java class.- Parameters:
fact- object to insert- Returns:
- fact handle assigned to the fact
- Throws:
NullPointerException- if argument is null- See Also:
-
insert0
Inserts a fact in working memory and returns a serializable fact handle. When
resolveCollectionsis set to true, and the fact is anIterableor an Array, the engine will instead insert its components and return a nullFactHandle. The engine will derive logical type of the fact(s) from their Java class names.Together with the
insert0(String, Object, boolean)method, this operation constitutes the core insert operations that are actually implemented by the engine. The other insert methods are just convenience wrappers of the two.- Parameters:
fact- object to insertresolveCollections- collection/array inspection flag- Returns:
- fact handle assigned to the fact, or
nullif multiple facts were inserted - Throws:
NullPointerException- if argument is null- See Also:
-
insert0
Inserts a fact and explicitly specifies its
Typename. WhenresolveCollectionsis set to true, and the fact is anIterableor an Array, the engine will instead insert its components, and return a nullFactHandle.Together with the
insert0(Object, boolean)method, this operation constitutes the core insert operations that are actually implemented by the engine. The other insert methods are just convenience wrappers of the two.- Parameters:
fact- object to insertresolveCollections- collection/array inspection flagtype- explicit logical type of the inserted fact(s)- Returns:
- fact handle assigned to the fact, or
nullif multiple facts were inserted - Throws:
NullPointerException- if argument is null- See Also:
-
delete
Deletes a fact from the working memory.- Parameters:
handle- The FactHandle associated with the fact to be deleted.
-
update
Updates a fact that already exists in the working memory- Parameters:
handle- fact handle, previously assigned to original factnewValue- an updated version of the fact
-
insertAs
Inserts a fact and explicitly specifies its
Typename.- Parameters:
type- explicit logical type of the inserted factfact- fact to insert- Returns:
- fact handle assigned to the fact
- Throws:
NullPointerException- if argument is null- See Also:
-