Interface RuleUnitExecutor

    • Method Detail

      • bind

        RuleUnitExecutor bind​(org.kie.api.KieBase kiebase)
        Bind this executor to a KieBase in order to execute the units defined in it.
      • getKieSession

        org.kie.api.runtime.KieSession getKieSession()
        Returns the KieSession internally used by this executor.
      • run

        int run​(Class<? extends RuleUnit> ruleUnitClass)
        Runs a RuleUnit of the given class.
      • run

        int run​(RuleUnit ruleUnit)
        Runs a RuleUnit of the given class.
      • runUntilHalt

        void runUntilHalt​(Class<? extends RuleUnit> ruleUnitClass)
        Runs until halt a RuleUnit of the given class.
      • runUntilHalt

        void runUntilHalt​(RuleUnit ruleUnit)
        Runs until halt a RuleUnit of the given class.
      • halt

        void halt()
        Requests the executor to stop running units.
      • newDataSource

        <T> DataSource<T> newDataSource​(String name,
                                        T... items)
        Creates a DataSource, optionally containing some items, and bind it this executor with the given name.
        Parameters:
        name - the name with which the newly created DataSource will be bound to this executor.
        items - the items contained in the DataSource.
      • bindVariable

        RuleUnitExecutor bindVariable​(String name,
                                      Object value)
        Binds a variable to this executor with a given name. This named variable will be then injected into RuleUnits executed on this executor using a naming convention.
        Parameters:
        name - the name with which the value will be bound to this executor.
        value - the value to bind.
      • dispose

        void dispose()
        Releases all the current executor resources, setting up the session for garbage collection. This method must always be called after finishing using the executor, or the engine will not free the memory used by the executor.
      • newRuleUnitExecutor

        static RuleUnitExecutor newRuleUnitExecutor​(org.kie.api.runtime.KieContainer kieContainer)
      • newRuleUnitExecutor

        static RuleUnitExecutor newRuleUnitExecutor​(org.kie.api.runtime.KieContainer kieContainer,
                                                    org.kie.api.runtime.KieSessionConfiguration conf)
      • newRuleUnitExecutor

        static RuleUnitExecutor newRuleUnitExecutor​(org.kie.api.runtime.KieContainer kieContainer,
                                                    String kSessionName)
      • newRuleUnitExecutor

        static RuleUnitExecutor newRuleUnitExecutor​(org.kie.api.runtime.KieContainer kieContainer,
                                                    String kSessionName,
                                                    org.kie.api.runtime.KieSessionConfiguration conf)
      • create

        static RuleUnitExecutor create()
        Creates a brand new RuleUnitExecutor
      • create

        static RuleUnitExecutor create​(org.kie.api.runtime.KieSession kieSession)
        Creates a brand new RuleUnitExecutor