Class DefaultKnowledgeHelper

java.lang.Object
org.drools.kiesession.consequence.DefaultKnowledgeHelper
All Implemented Interfaces:
Externalizable, Serializable, org.drools.base.rule.consequence.ConsequenceContext, KnowledgeHelper, KieContext, RuleContext

public class DefaultKnowledgeHelper extends Object implements KnowledgeHelper, Externalizable
See Also:
  • Field Details

  • Constructor Details

    • DefaultKnowledgeHelper

      public DefaultKnowledgeHelper()
    • DefaultKnowledgeHelper

      public DefaultKnowledgeHelper(ReteEvaluator reteEvaluator)
  • Method Details

    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • setActivation

      public void setActivation(InternalMatch internalMatch)
      Specified by:
      setActivation in interface KnowledgeHelper
    • getActivation

      public InternalMatch getActivation()
      Specified by:
      getActivation in interface KnowledgeHelper
    • reset

      public void reset()
      Specified by:
      reset in interface org.drools.base.rule.consequence.ConsequenceContext
    • blockMatch

      public void blockMatch(Match act)
      Specified by:
      blockMatch in interface RuleContext
    • unblockAllMatches

      public void unblockAllMatches(Match act)
      Specified by:
      unblockAllMatches in interface RuleContext
    • insertAsync

      public FactHandle insertAsync(Object object)
      Specified by:
      insertAsync in interface org.drools.base.rule.consequence.ConsequenceContext
    • insert

      public FactHandle insert(Object object)
      Specified by:
      insert in interface org.drools.base.rule.consequence.ConsequenceContext
    • insert

      public FactHandle insert(Object object, boolean dynamic)
      Specified by:
      insert in interface org.drools.base.rule.consequence.ConsequenceContext
    • insertLogical

      public FactHandle insertLogical(Object object, org.drools.base.beliefsystem.Mode belief)
      Specified by:
      insertLogical in interface org.drools.base.rule.consequence.ConsequenceContext
    • insertLogical

      public FactHandle insertLogical(Object object, org.drools.base.beliefsystem.Mode... beliefs)
      Specified by:
      insertLogical in interface org.drools.base.rule.consequence.ConsequenceContext
    • insertLogical

      public FactHandle insertLogical(Object object)
      Specified by:
      insertLogical in interface org.drools.base.rule.consequence.ConsequenceContext
      Specified by:
      insertLogical in interface RuleContext
    • insertLogical

      public FactHandle insertLogical(Object object, Object value)
      Specified by:
      insertLogical in interface org.drools.base.rule.consequence.ConsequenceContext
    • insertLogical

      public FactHandle insertLogical(EntryPoint ep, Object object)
      Specified by:
      insertLogical in interface RuleContext
    • bolster

      public FactHandle bolster(Object object)
      Specified by:
      bolster in interface org.drools.base.rule.consequence.ConsequenceContext
    • bolster

      public FactHandle bolster(Object object, Object value)
      Specified by:
      bolster in interface org.drools.base.rule.consequence.ConsequenceContext
    • cancelMatch

      public void cancelMatch(Match act)
      Specified by:
      cancelMatch in interface RuleContext
    • getFactHandle

      public FactHandle getFactHandle(Object object)
      Specified by:
      getFactHandle in interface org.drools.base.rule.consequence.ConsequenceContext
    • getFactHandle

      public FactHandle getFactHandle(FactHandle handle)
      Specified by:
      getFactHandle in interface org.drools.base.rule.consequence.ConsequenceContext
    • update

      public void update(FactHandle handle, Object newObject)
      Specified by:
      update in interface org.drools.base.rule.consequence.ConsequenceContext
    • update

      public void update(FactHandle handle)
      Specified by:
      update in interface org.drools.base.rule.consequence.ConsequenceContext
    • update

      public void update(FactHandle handle, org.drools.util.bitmask.BitMask mask, Class<?> modifiedClass)
      Specified by:
      update in interface org.drools.base.rule.consequence.ConsequenceContext
    • update

      public void update(Object object)
      Specified by:
      update in interface org.drools.base.rule.consequence.ConsequenceContext
    • update

      public void update(Object object, org.drools.util.bitmask.BitMask mask, Class<?> modifiedClass)
      Specified by:
      update in interface org.drools.base.rule.consequence.ConsequenceContext
    • retract

      public void retract(Object object)
      Specified by:
      retract in interface org.drools.base.rule.consequence.ConsequenceContext
    • retract

      public void retract(FactHandle handle)
      Specified by:
      retract in interface org.drools.base.rule.consequence.ConsequenceContext
    • delete

      public void delete(Object object)
      Specified by:
      delete in interface org.drools.base.rule.consequence.ConsequenceContext
    • delete

      public void delete(Object object, FactHandle.State fhState)
      Specified by:
      delete in interface org.drools.base.rule.consequence.ConsequenceContext
    • delete

      public void delete(FactHandle handle)
      Specified by:
      delete in interface org.drools.base.rule.consequence.ConsequenceContext
    • delete

      public void delete(FactHandle handle, FactHandle.State fhState)
      Specified by:
      delete in interface org.drools.base.rule.consequence.ConsequenceContext
    • getRule

      public org.drools.base.definitions.rule.impl.RuleImpl getRule()
      Specified by:
      getRule in interface org.drools.base.rule.consequence.ConsequenceContext
      Specified by:
      getRule in interface RuleContext
    • getTuple

      public Tuple getTuple()
      Specified by:
      getTuple in interface org.drools.base.rule.consequence.ConsequenceContext
    • getRequiredDeclarations

      public org.drools.base.rule.Declaration[] getRequiredDeclarations()
      Specified by:
      getRequiredDeclarations in interface org.drools.base.rule.consequence.ConsequenceContext
    • getWorkingMemory

      public WorkingMemory getWorkingMemory()
      Specified by:
      getWorkingMemory in interface KnowledgeHelper
    • getKnowledgeRuntime

      public KieRuntime getKnowledgeRuntime()
      Specified by:
      getKnowledgeRuntime in interface KieContext
    • toStatefulKnowledgeSession

      public StatefulKnowledgeSessionForRHS toStatefulKnowledgeSession()
    • getMatch

      public InternalMatch getMatch()
      Specified by:
      getMatch in interface org.drools.base.rule.consequence.ConsequenceContext
      Specified by:
      getMatch in interface KnowledgeHelper
      Specified by:
      getMatch in interface RuleContext
    • setFocus

      public void setFocus(String focus)
      Specified by:
      setFocus in interface org.drools.base.rule.consequence.ConsequenceContext
    • get

      public Object get(org.drools.base.rule.Declaration declaration)
      Specified by:
      get in interface org.drools.base.rule.consequence.ConsequenceContext
    • getDeclaration

      public org.drools.base.rule.Declaration getDeclaration(String identifier)
      Specified by:
      getDeclaration in interface org.drools.base.rule.consequence.ConsequenceContext
    • halt

      public void halt()
      Specified by:
      halt in interface org.drools.base.rule.consequence.ConsequenceContext
    • getEntryPoint

      public EntryPoint getEntryPoint(String id)
      Specified by:
      getEntryPoint in interface org.drools.base.rule.consequence.ConsequenceContext
    • getChannel

      public Channel getChannel(String id)
      Specified by:
      getChannel in interface org.drools.base.rule.consequence.ConsequenceContext
    • getChannels

      public Map<String,Channel> getChannels()
      Specified by:
      getChannels in interface org.drools.base.rule.consequence.ConsequenceContext
    • getFactHandleFromWM

      protected InternalFactHandle getFactHandleFromWM(Object object)
    • getFactHandleFromWM

      public static InternalFactHandle getFactHandleFromWM(ReteEvaluator reteEvaluator, Object object)
    • getContext

      public <T> T getContext(Class<T> contextClass)
      Specified by:
      getContext in interface org.drools.base.rule.consequence.ConsequenceContext
    • createProcessContext

      protected AbstractProcessContext createProcessContext()
    • sameNodeInstance

      protected boolean sameNodeInstance(NodeInstance subNodeInstance, String nodeInstanceId)
    • getKieRuntime

      public KieRuntime getKieRuntime()
      Specified by:
      getKieRuntime in interface KieContext
    • don

      public <T, K> T don(org.drools.base.factmodel.traits.Thing<K> core, Class<T> trait, boolean logical, org.drools.base.beliefsystem.Mode... modes)
    • don

      public <T, K> T don(K core, Class<T> trait)
      Specified by:
      don in interface org.drools.base.rule.consequence.ConsequenceContext
    • don

      public <T, K> T don(org.drools.base.factmodel.traits.Thing<K> core, Class<T> trait)
      Specified by:
      don in interface org.drools.base.rule.consequence.ConsequenceContext
    • don

      public <T, K> T don(K core, Collection<Class<? extends org.drools.base.factmodel.traits.Thing>> traits)
      Specified by:
      don in interface org.drools.base.rule.consequence.ConsequenceContext
    • shed

      public <T, K> org.drools.base.factmodel.traits.Thing<K> shed(org.drools.base.factmodel.traits.Thing<K> thing, Class<T> trait)
      Specified by:
      shed in interface org.drools.base.rule.consequence.ConsequenceContext
    • don

      public <T, K> T don(K core, Collection<Class<? extends org.drools.base.factmodel.traits.Thing>> traits, org.drools.base.beliefsystem.Mode... modes)
      Specified by:
      don in interface org.drools.base.rule.consequence.ConsequenceContext
    • don

      public <T, K> T don(K core, Collection<Class<? extends org.drools.base.factmodel.traits.Thing>> traits, boolean logical)
      Specified by:
      don in interface org.drools.base.rule.consequence.ConsequenceContext
    • don

      public <T, K> T don(K core, Class<T> trait, boolean logical)
      Specified by:
      don in interface org.drools.base.rule.consequence.ConsequenceContext
    • don

      public <T, K> T don(K core, Class<T> trait, org.drools.base.beliefsystem.Mode... modes)
      Specified by:
      don in interface org.drools.base.rule.consequence.ConsequenceContext
    • shed

      public <T, K, X extends org.drools.base.factmodel.traits.TraitableBean> org.drools.base.factmodel.traits.Thing<K> shed(org.drools.base.factmodel.traits.TraitableBean<K,X> core, Class<T> trait)
      Specified by:
      shed in interface org.drools.base.rule.consequence.ConsequenceContext
    • getProjectClassLoader

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