- All Superinterfaces:
Environment,EvaluationListeners,EvaluatorsContext,FluentEnvironment<S>,FluentImports<S>,RuleSet<RuntimeRule>,RuleSetContext<S,,RuntimeRule> RuntimeContext<S>
- All Known Subinterfaces:
StatefulSession,StatelessSession
- All Known Implementing Classes:
AbstractSessionWrapper
Base interface for both stateful and stateless sessions
-
Field Summary
Fields inherited from interface org.evrete.api.RuntimeContext
SALIENCE_COMPARATOR -
Method Summary
Modifier and TypeMethodDescriptionaddEventListener(SessionLifecycleListener listener) A convenience method that returns an instance ofCollectorfor inserting streams of facts.fire()default SInserts a collection of facts.default FactHandleInserts a fact in working memory and returns a serializable fact handle.default SInserts an array of facts.Inserts a fact in working memory and returns a serializable fact handle.Inserts a fact and explicitly specifies itsTypename.default SInserts a collection of facts, marking them as being of a specific type.default FactHandleInserts a fact and explicitly specifies itsTypename.default SInserts a collection of facts, marking them as being of a specific type.removeEventListener(SessionLifecycleListener listener) setActivationManager(ActivationManager activationManager) setExecutionPredicate(BooleanSupplier criteria) Session call's the supplier'sBooleanSupplier.getAsBoolean()method prior to each activation cycle.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
-
insert
Inserts a fact in working memory and returns a serializable fact handle.
- Parameters:
fact- object to insert- Returns:
- fact handle assigned to the fact
- Throws:
NullPointerException- if argument is null- See Also:
-
asCollector
A convenience method that returns an instance of
Collectorfor inserting streams of facts.- Type Parameters:
T- the type of input elements to the reduction operation- Returns:
- collector
-
setExecutionPredicate
Session call's the supplier's
BooleanSupplier.getAsBoolean()method prior to each activation cycle. If the provided value isfalsethen the cycle gets interrupted and session exits its fire(...) method.Along with the
ActivationManager, this method can be used to debug rules, to avoid infinite activation loops, or to prevent excessive consumption of computer resources.- Parameters:
criteria- - boolean value supplier- Returns:
- this session
-
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.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- type name- Returns:
- fact handle assigned to the fact, or
nullif multiple facts were inserted - Throws:
NullPointerException- if argument is null- See Also:
-
insertAs
Inserts a fact and explicitly specifies its
Typename.- Parameters:
type- type namefact- fact to insert- Returns:
- fact handle assigned to the fact
- Throws:
NullPointerException- if argument is null
-
insertAs
Inserts a collection of facts, marking them as being of a specific type.
- Parameters:
type- type nameobjects- objects to insert- Returns:
- this instance
- See Also:
-
insertAs
Inserts a collection of facts, marking them as being of a specific type.
- Parameters:
type- type nameobjects- objects to insert- Returns:
- this instance
- See Also:
-
insert
Inserts a collection of facts.
- Parameters:
objects- objects to insert- Returns:
- this instance
- See Also:
-
insert
Inserts an array of facts.
- Parameters:
objects- objects to insert- Returns:
- this instance
- See Also:
-
getActivationManager
ActivationManager getActivationManager() -
setActivationManager
-
addEventListener
-
removeEventListener
-
getParentContext
Knowledge getParentContext() -
fire
Object fire()
-