Interface RuleBuilder<C extends RuntimeContext<C>>
-
- All Superinterfaces:
Environment,FluentEnvironment<Rule>,LhsFactSelector<LhsBuilder<C>>,Named,NamedType.Resolver,Rule
public interface RuleBuilder<C extends RuntimeContext<C>> extends Rule, LhsFactSelector<LhsBuilder<C>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default EvaluatorHandlecreateCondition(String expression)Compiles and registers the provided predicate with the current context (aKnowledgeor aRuleSession).EvaluatorHandlecreateCondition(String expression, double complexity)Compiles and registers the provided predicate with the current context (aKnowledgeor aRuleSession).EvaluatorHandlecreateCondition(Predicate<Object[]> predicate, double complexity, String... references)Registers the provided predicate with the current context (aKnowledgeor aRuleSession).EvaluatorHandlecreateCondition(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).EvaluatorHandlecreateCondition(ValuesPredicate predicate, double complexity, String... references)Registers the provided predicate with the current context (aKnowledgeor aRuleSession).EvaluatorHandlecreateCondition(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).LhsBuilder<C>getLhs()CgetRuntime()<Z> RuleBuilder<C>property(String property, Z value)RuleBuilder<C>salience(int salience)-
Methods inherited from interface org.evrete.api.Environment
get, get, getPropertyNames
-
Methods inherited from interface org.evrete.api.FluentEnvironment
set
-
Methods inherited from interface org.evrete.api.LhsFactSelector
forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach
-
Methods inherited from interface org.evrete.api.NamedType.Resolver
getDeclaredFactTypes, resolve
-
Methods inherited from interface org.evrete.api.Rule
chainRhs, getRhs, getSalience, setName, setRhs, setRhs, setSalience
-
-
-
-
Method Detail
-
getLhs
LhsBuilder<C> getLhs()
-
salience
RuleBuilder<C> salience(int salience)
-
property
<Z> RuleBuilder<C> property(String property, Z value)
-
getRuntime
C getRuntime()
-
createCondition
default EvaluatorHandle createCondition(ValuesPredicate 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:
FieldReference,WorkUnit
-
createCondition
default EvaluatorHandle createCondition(ValuesPredicate predicate, 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 predicatereferences- field references- Returns:
- evaluator handle
- See Also:
FieldReference,WorkUnit
-
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 used in theEvaluatorsContext.replaceEvaluator(EvaluatorHandle, Evaluator)andEvaluatorsContext.replaceEvaluator(EvaluatorHandle, ValuesPredicate)methods to replace existing conditions on the fly.- Parameters:
predicate- condition predicatereferences- field references- Returns:
- evaluator handle
- See Also:
FieldReference,WorkUnit
-
createCondition
default EvaluatorHandle createCondition(Predicate<Object[]> predicate, 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 predicatereferences- field references- Returns:
- evaluator handle
- See Also:
FieldReference,WorkUnit
-
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:
WorkUnit
-
createCondition
EvaluatorHandle createCondition(ValuesPredicate 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:
FieldReference,WorkUnit
-
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:
FieldReference,WorkUnit
-
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:
FieldReference,WorkUnit
-
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:
FieldReference,WorkUnit
-
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:
WorkUnit
-
-