- All Superinterfaces:
SessionOps
Provides access to the rule's RHS (Right-Hand Side) variables and
the session memory's methods.
-
Method Summary
Modifier and TypeMethodDescriptionRemoves an instance from the working memory.default RhsContextdeleteFact(String factRef) Deletes a fact from the working memory by its reference name.default <T> TA typed version of theget()method with an explicit generic cast type.default <T> TA typed version of thegetObject()method.Returns the current fact by its name.getRule()Returns a reference to the current rule and its environment.default RuleSession<?>Provides access to the runtime context, equivalent togetRule().getRuntime().Notifies the working memory that one of its objects has changed.default RhsContextupdateFact(String factRef) Updates a fact in the working memory by its reference name.
-
Method Details
-
update
Notifies the working memory that one of its objects has changed. Always call this method to re-evaluate conditions, and avoid calling it if the changes are not relevant to the conditions.- Parameters:
obj- the changed object- Returns:
- the context itself so methods can be chained
-
delete
Removes an instance from the working memory.- Parameters:
obj- the object to remove- Returns:
- the context itself so methods can be chained
-
getRule
RuntimeRule getRule()Returns a reference to the current rule and its environment.- Returns:
- the current rule
-
getRuntime
Provides access to the runtime context, equivalent togetRule().getRuntime().- Returns:
- the runtime context (session)
-
deleteFact
Deletes a fact from the working memory by its reference name.- Parameters:
factRef- the reference name of the fact to delete- Returns:
- the context itself so methods can be chained
-
updateFact
Updates a fact in the working memory by its reference name.- Parameters:
factRef- the reference name of the fact to update- Returns:
- the context itself so methods can be chained
-
getObject
Returns the current fact by its name.- Parameters:
name- the name of the fact- Returns:
- the current instance
-
get
A typed version of thegetObject()method.- Type Parameters:
T- the type to cast the fact to- Parameters:
name- the name of the fact- Returns:
- the typed instance
-
get
A typed version of theget()method with an explicit generic cast type.- Type Parameters:
T- the type to cast the fact to- Parameters:
name- the name of the facttype- the class type to cast the fact to- Returns:
- the typed instance
-