Interface KnowledgeHelper

  • All Superinterfaces:
    org.drools.base.rule.consequence.ConsequenceContext, org.kie.api.runtime.KieContext, org.kie.api.runtime.rule.RuleContext, java.io.Serializable

    public interface KnowledgeHelper
    extends org.drools.base.rule.consequence.ConsequenceContext, java.io.Serializable
    KnowledgeHelper implementation types are injected into consequenses instrumented at compile time and instances passed at runtime. It provides convenience methods for users to interact with the WorkingMemory.

    Of particular interest is the update method as it allows an object to be modified without having to specify the facthandle, because they are not passed to the consequence at runtime. To achieve this the implementation will need to lookup the fact handle of the object form the WorkingMemory.

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      InternalMatch getMatch()  
      java.lang.ClassLoader getProjectClassLoader()  
      WorkingMemory getWorkingMemory()  
      default void restoreActivationOnConsequenceFailure​(InternalMatch internalMatch)  
      void setActivation​(InternalMatch internalMatch)  
      • Methods inherited from interface org.drools.base.rule.consequence.ConsequenceContext

        bolster, bolster, delete, delete, delete, delete, don, don, don, don, don, don, don, get, getChannel, getChannels, getContext, getDeclaration, getEntryPoint, getFactHandle, getFactHandle, getRequiredDeclarations, getRule, getTuple, guard, guard, halt, insert, insert, insertAsync, insertLogical, insertLogical, insertLogical, insertLogical, reset, retract, retract, run, run, run, setFocus, shed, shed, update, update, update, update, update
      • Methods inherited from interface org.kie.api.runtime.KieContext

        getKieBase, getKieRuntime, getKnowledgeRuntime
      • Methods inherited from interface org.kie.api.runtime.rule.RuleContext

        blockMatch, cancelMatch, insertLogical, unblockAllMatches
    • Method Detail

      • setActivation

        void setActivation​(InternalMatch internalMatch)
      • restoreActivationOnConsequenceFailure

        default void restoreActivationOnConsequenceFailure​(InternalMatch internalMatch)
      • getMatch

        InternalMatch getMatch()
        Specified by:
        getMatch in interface org.drools.base.rule.consequence.ConsequenceContext
        Specified by:
        getMatch in interface org.kie.api.runtime.rule.RuleContext
      • getProjectClassLoader

        java.lang.ClassLoader getProjectClassLoader()
        Specified by:
        getProjectClassLoader in interface org.drools.base.rule.consequence.ConsequenceContext