Interface KnowledgeHelper

  • All Superinterfaces:
    org.kie.api.runtime.KieContext, org.kie.api.runtime.rule.RuleContext, Serializable
    All Known Implementing Classes:
    DefaultKnowledgeHelper

    public interface KnowledgeHelper
    extends org.kie.api.runtime.rule.RuleContext, 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 Detail

      • setActivation

        void setActivation​(Activation agendaItem)
      • reset

        void reset()
      • insert

        InternalFactHandle insert​(Object object)
        Asserts an object
        Parameters:
        object - - the object to be asserted
      • insertAsync

        org.kie.api.runtime.rule.FactHandle insertAsync​(Object object)
      • insert

        InternalFactHandle insert​(Object object,
                                  boolean dynamic)
        Asserts an object specifying that it implement the onPropertyChange listener
        Parameters:
        object - - the object to be asserted
        dynamic - - specifies the object implements onPropertyChangeListener
      • insertLogical

        InternalFactHandle insertLogical​(Object object)
        Specified by:
        insertLogical in interface org.kie.api.runtime.rule.RuleContext
      • insertLogical

        InternalFactHandle insertLogical​(Object object,
                                         org.kie.api.internal.runtime.beliefs.Mode... beliefs)
      • cancelRemainingPreviousLogicalDependencies

        void cancelRemainingPreviousLogicalDependencies()
      • update

        void update​(org.kie.api.runtime.rule.FactHandle handle,
                    Object newObject)
      • update

        void update​(org.kie.api.runtime.rule.FactHandle newObject)
      • update

        void update​(org.kie.api.runtime.rule.FactHandle newObject,
                    BitMask mask,
                    Class<?> modifiedClass)
      • update

        void update​(Object newObject)
      • retract

        void retract​(org.kie.api.runtime.rule.FactHandle handle)
        Deprecated.
        Use delete
      • retract

        void retract​(Object handle)
        Deprecated.
        Use delete
      • delete

        void delete​(Object handle)
      • delete

        void delete​(Object object,
                    org.kie.api.runtime.rule.FactHandle.State fhState)
      • delete

        void delete​(org.kie.api.runtime.rule.FactHandle handle)
      • delete

        void delete​(org.kie.api.runtime.rule.FactHandle handle,
                    org.kie.api.runtime.rule.FactHandle.State fhState)
      • getRule

        RuleImpl getRule()
        Specified by:
        getRule in interface org.kie.api.runtime.rule.RuleContext
        Returns:
        - The rule name
      • getTuple

        Tuple getTuple()
      • getMatch

        Activation getMatch()
        Specified by:
        getMatch in interface org.kie.api.runtime.rule.RuleContext
      • getEntryPoint

        org.kie.api.runtime.rule.EntryPoint getEntryPoint​(String id)
      • getChannel

        org.kie.api.runtime.Channel getChannel​(String id)
      • getChannels

        Map<String,​org.kie.api.runtime.Channel> getChannels()
      • setFocus

        void setFocus​(String focus)
      • halt

        void halt()
      • getContext

        <T> T getContext​(Class<T> contextClass)
      • don

        <T,​K> T don​(K core,
                          Class<T> trait,
                          boolean logical)
      • don

        <T,​K> T don​(K core,
                          Class<T> trait,
                          org.kie.api.internal.runtime.beliefs.Mode... modes)
      • don

        <T,​K> T don​(K core,
                          Class<T> trait)
      • don

        <T,​K> T don​(Thing<K> core,
                          Class<T> trait)
      • don

        <T,​K> T don​(K core,
                          Collection<Class<? extends Thing>> trait,
                          org.kie.api.internal.runtime.beliefs.Mode... modes)
      • getProjectClassLoader

        ClassLoader getProjectClassLoader()
      • run

        default void run​(String ruleUnitName)
      • run

        default void run​(Object ruleUnit)
      • run

        default void run​(Class<?> ruleUnitClass)
      • guard

        default void guard​(Object ruleUnit)
      • guard

        default void guard​(Class<?> ruleUnitClass)