public interface RuleSession<S extends RuleSession<S>> extends RuntimeContext<S>, RuleSet<RuntimeRule>
Base interface for both stateful and stateless sessions
SALIENCE_COMPARATOR| Modifier and Type | Method and Description |
|---|---|
S |
addEventListener(SessionLifecycleListener listener) |
<T> Collector<T,?,S> |
asCollector()
A convenience method that returns an instance of
Collector for inserting
streams of facts. |
Object |
fire() |
ActivationManager |
getActivationManager() |
Knowledge |
getParentContext() |
default S |
insert(Collection<?> objects)
Inserts a collection of facts.
|
default S |
insert(Object... objects)
Inserts an array of facts.
|
FactHandle |
insert(Object fact)
Inserts a fact in working memory and returns a serializable fact handle.
|
default S |
insert(String type,
Collection<?> objects)
Inserts a collection of facts, marking them as being of a specific type.
|
default FactHandle |
insert(String type,
Object fact) |
default S |
insertAs(String type,
Collection<?> objects)
Inserts a collection of facts, marking them as being of a specific type.
|
default S |
insertAs(String type,
Object... objects)
Inserts a collection of facts, marking them as being of a specific type.
|
FactHandle |
insertAs(String type,
Object fact)
Inserts a fact and explicitly specifies its
Type name. |
S |
removeEventListener(SessionLifecycleListener listener) |
S |
setActivationManager(ActivationManager activationManager) |
S |
setExecutionPredicate(BooleanSupplier criteria)
Session call's the supplier's
BooleanSupplier.getAsBoolean() method prior to each
activation cycle. |
default S |
setFireCriteria(BooleanSupplier criteria)
Deprecated.
in favor of
setExecutionPredicate(BooleanSupplier) |
getActivationManagerFactory, getClassLoader, getConfiguration, getExpressionResolver, getRuleComparator, getService, getTypeResolver, newRule, newRule, setActivationManagerFactory, setActivationManagerFactory, setActivationMode, setClassLoader, setRuleComparator, wrapTypeResolveraddListener, removeListeneraddImport, addImport, getImports, getJavaImportssetget, get, getPropertyNamesaddEvaluator, addEvaluator, replaceEvaluatorcompileRule, getRule, getRule, getRules, ruleExistsFactHandle insert(Object fact)
Inserts a fact in working memory and returns a serializable fact handle.
fact - object to insertNullPointerException - if argument is nullFactHandle<T> Collector<T,?,S> asCollector()
A convenience method that returns an instance of Collector for inserting
streams of facts.
@Deprecated default S setFireCriteria(BooleanSupplier criteria)
setExecutionPredicate(BooleanSupplier)S setExecutionPredicate(BooleanSupplier criteria)
Session call's the supplier's BooleanSupplier.getAsBoolean() method prior to each
activation cycle. If the provided value is false then 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.
criteria - - boolean value supplierdefault FactHandle insert(String type, Object fact)
type - type namefact - fact to insertNullPointerException - if argument is nullinsertAs(String, Object)FactHandle insertAs(String type, Object fact)
Inserts a fact and explicitly specifies its Type name.
type - type namefact - fact to insertNullPointerException - if argument is nulldefault S insert(String type, Collection<?> objects)
Inserts a collection of facts, marking them as being of a specific type.
type - type nameobjects - objects to insertinsertAs(String, Object)default S insertAs(String type, Collection<?> objects)
Inserts a collection of facts, marking them as being of a specific type.
type - type nameobjects - objects to insertinsertAs(String, Object)default S insertAs(String type, Object... objects)
Inserts a collection of facts, marking them as being of a specific type.
type - type nameobjects - objects to insertinsertAs(String, Object)default S insert(Collection<?> objects)
Inserts a collection of facts.
objects - objects to insertinsert(Object)default S insert(Object... objects)
Inserts an array of facts.
objects - objects to insertinsert(Object)ActivationManager getActivationManager()
S setActivationManager(ActivationManager activationManager)
S addEventListener(SessionLifecycleListener listener)
S removeEventListener(SessionLifecycleListener listener)
Knowledge getParentContext()
Object fire()
Copyright © 2021. All rights reserved.