Interface RuleBuilder<C extends RuntimeContext<C>>
- All Superinterfaces:
Environment,FluentEnvironment<Rule>,LhsFactSelector<LhsBuilder<C>>,Named,NamedType.Resolver,Rule
-
Method Summary
Modifier and TypeMethodDescriptiondefault EvaluatorHandlecreateCondition(String expression) Compiles and registers the provided predicate with the current context (aKnowledgeor aRuleSession).createCondition(String expression, double complexity) Compiles and registers the provided predicate with the current context (aKnowledgeor aRuleSession).createCondition(Predicate<Object[]> predicate, double complexity, String... references) Registers the provided predicate with the current context (aKnowledgeor aRuleSession).createCondition(Predicate<Object[]> predicate, double complexity, FieldReference... references) Registers the provided predicate with the current context (aKnowledgeor aRuleSession).default EvaluatorHandlecreateCondition(Predicate<Object[]> predicate, String... references) Registers the provided predicate with the current context (aKnowledgeor aRuleSession).default EvaluatorHandlecreateCondition(Predicate<Object[]> predicate, FieldReference... references) Registers the provided predicate with the current context (aKnowledgeor aRuleSession).createCondition(ValuesPredicate predicate, double complexity, String... references) Registers the provided predicate with the current context (aKnowledgeor aRuleSession).createCondition(ValuesPredicate predicate, double complexity, FieldReference... references) Registers the provided predicate with the current context (aKnowledgeor aRuleSession).default EvaluatorHandlecreateCondition(ValuesPredicate predicate, String... references) Registers the provided predicate with the current context (aKnowledgeor aRuleSession).default EvaluatorHandlecreateCondition(ValuesPredicate predicate, FieldReference... references) Registers the provided predicate with the current context (aKnowledgeor aRuleSession).getLhs()<Z> RuleBuilder<C> salience(int salience) Methods inherited from interface org.evrete.api.Environment
get, get, getPropertyNamesMethods inherited from interface org.evrete.api.FluentEnvironment
setMethods inherited from interface org.evrete.api.LhsFactSelector
forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEachMethods inherited from interface org.evrete.api.NamedType.Resolver
getDeclaredFactTypes, resolveMethods inherited from interface org.evrete.api.Rule
chainRhs, getRhs, getSalience, setName, setRhs, setRhs, setSalience
-
Method Details
-
getLhs
LhsBuilder<C> getLhs() -
salience
-
property
-
getRuntime
C getRuntime() -
createCondition
Registers the provided predicate with the current context (a
Knowledgeor aRuleSession). The resultingEvaluatorHandlecan later be used in theLhsBuilder.where(EvaluatorHandle...)code blocks, shared among other rules (if appropriate), or provided to theEvaluatorsContext.replaceEvaluator(EvaluatorHandle, Evaluator)andEvaluatorsContext.replaceEvaluator(EvaluatorHandle, ValuesPredicate)methods to replace conditions on the fly.- Parameters:
predicate- condition predicatereferences- field references- Returns:
- evaluator handle
- See Also:
-
createCondition
Registers the provided predicate with the current context (a
Knowledgeor aRuleSession). The resultingEvaluatorHandlecan later be used in theLhsBuilder.where(EvaluatorHandle...)code blocks, shared among other rules (if appropriate), or provided to theEvaluatorsContext.replaceEvaluator(EvaluatorHandle, Evaluator)andEvaluatorsContext.replaceEvaluator(EvaluatorHandle, ValuesPredicate)methods to replace conditions on the fly.- Parameters:
predicate- condition predicatereferences- field references- Returns:
- evaluator handle
- See Also:
-
createCondition
default EvaluatorHandle createCondition(Predicate<Object[]> predicate, FieldReference... references) Registers the provided predicate with the current context (a
Knowledgeor aRuleSession). The resultingEvaluatorHandlecan later be used in theLhsBuilder.where(EvaluatorHandle...)code blocks, shared among other rules (if appropriate), or provided to theEvaluatorsContext.replaceEvaluator(EvaluatorHandle, Evaluator)andEvaluatorsContext.replaceEvaluator(EvaluatorHandle, ValuesPredicate)methods to replace conditions on the fly.- Parameters:
predicate- condition predicatereferences- field references- Returns:
- evaluator handle
- See Also:
-
createCondition
Registers the provided predicate with the current context (a
Knowledgeor aRuleSession). The resultingEvaluatorHandlecan later be used in theLhsBuilder.where(EvaluatorHandle...)code blocks, shared among other rules (if appropriate), or provided to theEvaluatorsContext.replaceEvaluator(EvaluatorHandle, Evaluator)andEvaluatorsContext.replaceEvaluator(EvaluatorHandle, ValuesPredicate)methods to replace conditions on the fly.- Parameters:
predicate- condition predicatereferences- field references- Returns:
- evaluator handle
- See Also:
-
createCondition
EvaluatorHandle createCondition(String expression, double complexity) throws org.evrete.runtime.compiler.CompilationException Compiles and registers the provided predicate with the current context (a
Knowledgeor aRuleSession). The resultingEvaluatorHandlecan later be used in theLhsBuilder.where(EvaluatorHandle...)code blocks, shared among other rules (if appropriate), or provided to theEvaluatorsContext.replaceEvaluator(EvaluatorHandle, Evaluator)andEvaluatorsContext.replaceEvaluator(EvaluatorHandle, ValuesPredicate)methods to replace conditions on the fly.- Parameters:
expression- literal conditioncomplexity- condition's relative complexity- Returns:
- evaluator handle
- Throws:
org.evrete.runtime.compiler.CompilationException- if the engine fails to compile the expression- See Also:
-
createCondition
Registers the provided predicate with the current context (a
Knowledgeor aRuleSession). The resultingEvaluatorHandlecan later be used in theLhsBuilder.where(EvaluatorHandle...)code blocks, shared among other rules (if appropriate), or provided to theEvaluatorsContext.replaceEvaluator(EvaluatorHandle, Evaluator)andEvaluatorsContext.replaceEvaluator(EvaluatorHandle, ValuesPredicate)methods to replace conditions on the fly.- Parameters:
predicate- condition predicatecomplexity- condition's relative complexityreferences- field references- Returns:
- evaluator handle
- See Also:
-
createCondition
EvaluatorHandle createCondition(Predicate<Object[]> predicate, double complexity, String... references) Registers the provided predicate with the current context (a
Knowledgeor aRuleSession). The resultingEvaluatorHandlecan later be used in theLhsBuilder.where(EvaluatorHandle...)code blocks, shared among other rules (if appropriate), or provided to theEvaluatorsContext.replaceEvaluator(EvaluatorHandle, Evaluator)andEvaluatorsContext.replaceEvaluator(EvaluatorHandle, ValuesPredicate)methods to replace conditions on the fly.- Parameters:
predicate- condition predicatecomplexity- condition's relative complexityreferences- field references- Returns:
- evaluator handle
- See Also:
-
createCondition
EvaluatorHandle createCondition(ValuesPredicate predicate, double complexity, FieldReference... references) Registers the provided predicate with the current context (a
Knowledgeor aRuleSession). The resultingEvaluatorHandlecan later be used in theLhsBuilder.where(EvaluatorHandle...)code blocks, shared among other rules (if appropriate), or provided to theEvaluatorsContext.replaceEvaluator(EvaluatorHandle, Evaluator)andEvaluatorsContext.replaceEvaluator(EvaluatorHandle, ValuesPredicate)methods to replace conditions on the fly.- Parameters:
predicate- condition predicatecomplexity- condition's relative complexityreferences- field references- Returns:
- evaluator handle
- See Also:
-
createCondition
EvaluatorHandle createCondition(Predicate<Object[]> predicate, double complexity, FieldReference... references) Registers the provided predicate with the current context (a
Knowledgeor aRuleSession). The resultingEvaluatorHandlecan later be used in theLhsBuilder.where(EvaluatorHandle...)code blocks, shared among other rules (if appropriate), or provided to theEvaluatorsContext.replaceEvaluator(EvaluatorHandle, Evaluator)andEvaluatorsContext.replaceEvaluator(EvaluatorHandle, ValuesPredicate)methods to replace conditions on the fly.- Parameters:
predicate- condition predicatecomplexity- condition's relative complexityreferences- field references- Returns:
- evaluator handle
- See Also:
-
createCondition
default EvaluatorHandle createCondition(String expression) throws org.evrete.runtime.compiler.CompilationException Compiles and registers the provided predicate with the current context (a
Knowledgeor aRuleSession). The resultingEvaluatorHandlecan later be used in theLhsBuilder.where(EvaluatorHandle...)code blocks, shared among other rules (if appropriate), or provided to theEvaluatorsContext.replaceEvaluator(EvaluatorHandle, Evaluator)andEvaluatorsContext.replaceEvaluator(EvaluatorHandle, ValuesPredicate)methods to replace conditions on the fly.- Parameters:
expression- literal condition- Returns:
- evaluator handle
- Throws:
org.evrete.runtime.compiler.CompilationException- if the engine fails to compile the expression- See Also:
-