- All Superinterfaces:
Environment,EvaluationListeners,EvaluatorsContext,FluentEnvironment<Knowledge>,FluentImports<Knowledge>,RuleSet<RuleDescriptor>,RuleSetContext<Knowledge,,RuleDescriptor> RuntimeContext<Knowledge>
- All Known Implementing Classes:
KnowledgeWrapper
Knowledge is a preprocessed ruleset. Although the engine allows direct creation of rule sessions,
having a prepared ruleset enables faster instantiation of sessions. Building knowledge instances
especially makes sense if the rules use literal conditions and therefore require a very CPU-intensive
compilation stage.
-
Field Summary
Fields inherited from interface org.evrete.api.RuntimeContext
SALIENCE_COMPARATOR -
Method Summary
Modifier and TypeMethodDescriptiondefault <A extends ActivationManager>
KnowledgeactivationManager(Class<A> factory) Sets the Activation Manager for the Knowledge instance.Retrieves a collection of active RuleSessions associated with the Knowledge.default StatefulSessionCreates a new stateful session with the specified activation mode.default StatelessSessionCreates a newStatelessSessionwith the specifiedActivationMode.Methods inherited from interface org.evrete.api.Environment
get, get, getPropertyNamesMethods inherited from interface org.evrete.api.EvaluationListeners
addListener, removeListenerMethods inherited from interface org.evrete.api.EvaluatorsContext
addEvaluator, addEvaluator, getEvaluator, replaceEvaluator, replaceEvaluatorMethods inherited from interface org.evrete.api.FluentEnvironment
setMethods inherited from interface org.evrete.api.FluentImports
addImport, addImport, getImports, getJavaImportsMethods inherited from interface org.evrete.api.RuleSet
getRule, getRule, getRules, resolveFieldReferences, ruleExists, setRuleBuilderExceptionHandlerMethods inherited from interface org.evrete.api.RuntimeContext
builder, compile, compile, configureTypes, getActivationManagerFactory, getClassLoader, getConfiguration, getExpressionResolver, getRuleComparator, getService, getSourceCompiler, getTypeResolver, newRule, newRule, setActivationManagerFactory, setActivationManagerFactory, setActivationMode, setClassLoader, setRuleComparator, wrapTypeResolver
-
Method Details
-
getSessions
Collection<RuleSession<?>> getSessions()Retrieves a collection of active RuleSessions associated with the Knowledge.- Returns:
- a collection of RuleSessions
-
newStatefulSession
StatefulSession newStatefulSession()- Returns:
- new stateful session
-
newStatefulSession
Creates a new stateful session with the specified activation mode.- Parameters:
mode- the activation mode to set for the session- Returns:
- a new stateful session instance
-
newStatelessSession
StatelessSession newStatelessSession()- Returns:
- new stateless session
-
newStatelessSession
Creates a newStatelessSessionwith the specifiedActivationMode.- Parameters:
mode- the activation mode to set for the session- Returns:
- a new stateless session instance with the specified activation mode
-
activationManager
Sets the Activation Manager for the Knowledge instance.- Type Parameters:
A- the type of Activation Manager- Parameters:
factory- the class of the Activation Manager- Returns:
- the updated Knowledge instance
-