Class CommandBasedStatefulKnowledgeSession

  • All Implemented Interfaces:
    org.kie.api.event.KieRuntimeEventManager, org.kie.api.event.process.ProcessEventManager, org.kie.api.event.rule.RuleRuntimeEventManager, org.kie.api.runtime.CommandExecutor, org.kie.api.runtime.KieRuntime, org.kie.api.runtime.KieSession, org.kie.api.runtime.process.ProcessRuntime, org.kie.api.runtime.process.StatefulProcessSession, org.kie.api.runtime.rule.EntryPoint, org.kie.api.runtime.rule.RuleRuntime, org.kie.api.runtime.rule.StatefulRuleSession, org.kie.internal.process.CorrelationAwareProcessRuntime, org.kie.internal.runtime.StatefulKnowledgeSession

    public class CommandBasedStatefulKnowledgeSession
    extends AbstractRuntime
    implements org.kie.internal.runtime.StatefulKnowledgeSession, org.kie.internal.process.CorrelationAwareProcessRuntime
    • Constructor Detail

      • CommandBasedStatefulKnowledgeSession

        public CommandBasedStatefulKnowledgeSession​(org.kie.api.runtime.ExecutableRunner runner)
    • Method Detail

      • getId

        @Deprecated
        public int getId()
        Deprecated.
        Deprecated use getIdentifier() instead
        Specified by:
        getId in interface org.kie.api.runtime.KieSession
      • getIdentifier

        public long getIdentifier()
        Specified by:
        getIdentifier in interface org.kie.api.runtime.KieSession
      • getProcessInstance

        public org.kie.api.runtime.process.ProcessInstance getProcessInstance​(long id)
        Specified by:
        getProcessInstance in interface org.kie.api.runtime.process.ProcessRuntime
      • getProcessInstance

        public org.kie.api.runtime.process.ProcessInstance getProcessInstance​(long id,
                                                                              boolean readOnly)
        Specified by:
        getProcessInstance in interface org.kie.api.runtime.process.ProcessRuntime
      • abortProcessInstance

        public void abortProcessInstance​(long id)
        Specified by:
        abortProcessInstance in interface org.kie.api.runtime.process.ProcessRuntime
      • getRunner

        public org.kie.api.runtime.ExecutableRunner getRunner()
      • getProcessInstances

        public Collection<org.kie.api.runtime.process.ProcessInstance> getProcessInstances()
        Specified by:
        getProcessInstances in interface org.kie.api.runtime.process.ProcessRuntime
      • getWorkItemManager

        public WorkItemManager getWorkItemManager()
        Specified by:
        getWorkItemManager in interface org.kie.api.runtime.process.ProcessRuntime
      • signalEvent

        public void signalEvent​(String type,
                                Object event)
        Specified by:
        signalEvent in interface org.kie.api.runtime.process.ProcessRuntime
      • signalEvent

        public void signalEvent​(String type,
                                Object event,
                                long processInstanceId)
        Specified by:
        signalEvent in interface org.kie.api.runtime.process.ProcessRuntime
      • startProcess

        public org.kie.api.runtime.process.ProcessInstance startProcess​(String processId)
        Specified by:
        startProcess in interface org.kie.api.runtime.process.ProcessRuntime
      • startProcess

        public org.kie.api.runtime.process.ProcessInstance startProcess​(String processId,
                                                                        Map<String,​Object> parameters)
        Specified by:
        startProcess in interface org.kie.api.runtime.process.ProcessRuntime
      • startProcess

        public org.kie.api.runtime.process.ProcessInstance startProcess​(String processId,
                                                                        org.kie.api.runtime.rule.AgendaFilter agendaFilter)
        Specified by:
        startProcess in interface org.kie.api.runtime.process.ProcessRuntime
      • startProcess

        public org.kie.api.runtime.process.ProcessInstance startProcess​(String processId,
                                                                        Map<String,​Object> parameters,
                                                                        org.kie.api.runtime.rule.AgendaFilter agendaFilter)
        Specified by:
        startProcess in interface org.kie.api.runtime.process.ProcessRuntime
      • createProcessInstance

        public org.kie.api.runtime.process.ProcessInstance createProcessInstance​(String processId,
                                                                                 Map<String,​Object> parameters)
        Specified by:
        createProcessInstance in interface org.kie.api.runtime.process.ProcessRuntime
      • startProcessInstance

        public org.kie.api.runtime.process.ProcessInstance startProcessInstance​(long processInstanceId)
        Specified by:
        startProcessInstance in interface org.kie.api.runtime.process.ProcessRuntime
      • dispose

        public void dispose()
        Specified by:
        dispose in interface org.kie.api.runtime.KieSession
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.kie.api.runtime.KieSession
      • fireAllRules

        public int fireAllRules()
        Specified by:
        fireAllRules in interface org.kie.api.runtime.rule.StatefulRuleSession
      • fireAllRules

        public int fireAllRules​(int max)
        Specified by:
        fireAllRules in interface org.kie.api.runtime.rule.StatefulRuleSession
      • fireAllRules

        public int fireAllRules​(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
        Specified by:
        fireAllRules in interface org.kie.api.runtime.rule.StatefulRuleSession
      • fireAllRules

        public int fireAllRules​(org.kie.api.runtime.rule.AgendaFilter agendaFilter,
                                int max)
        Specified by:
        fireAllRules in interface org.kie.api.runtime.rule.StatefulRuleSession
      • fireUntilHalt

        public void fireUntilHalt()
        Specified by:
        fireUntilHalt in interface org.kie.api.runtime.rule.StatefulRuleSession
      • fireUntilHalt

        public void fireUntilHalt​(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
        Specified by:
        fireUntilHalt in interface org.kie.api.runtime.rule.StatefulRuleSession
      • getKieBase

        public org.kie.api.KieBase getKieBase()
        Specified by:
        getKieBase in interface org.kie.api.runtime.KieRuntime
        Specified by:
        getKieBase in interface org.kie.internal.runtime.StatefulKnowledgeSession
      • registerChannel

        public void registerChannel​(String name,
                                    org.kie.api.runtime.Channel channel)
        Specified by:
        registerChannel in interface org.kie.api.runtime.KieRuntime
      • unregisterChannel

        public void unregisterChannel​(String name)
        Specified by:
        unregisterChannel in interface org.kie.api.runtime.KieRuntime
      • getChannels

        public Map<String,​org.kie.api.runtime.Channel> getChannels()
        Specified by:
        getChannels in interface org.kie.api.runtime.KieRuntime
      • getAgenda

        public org.kie.api.runtime.rule.Agenda getAgenda()
        Specified by:
        getAgenda in interface org.kie.api.runtime.rule.RuleRuntime
      • getFactHandle

        public org.kie.api.runtime.rule.FactHandle getFactHandle​(Object object)
        Specified by:
        getFactHandle in interface org.kie.api.runtime.rule.EntryPoint
      • getFactHandles

        public <T extends org.kie.api.runtime.rule.FactHandle> Collection<T> getFactHandles()
        Specified by:
        getFactHandles in interface org.kie.api.runtime.rule.EntryPoint
      • getFactHandles

        public <T extends org.kie.api.runtime.rule.FactHandle> Collection<T> getFactHandles​(org.kie.api.runtime.ObjectFilter filter)
        Specified by:
        getFactHandles in interface org.kie.api.runtime.rule.EntryPoint
      • getObjects

        public Collection<? extends Object> getObjects()
        Specified by:
        getObjects in interface org.kie.api.runtime.rule.EntryPoint
      • getObjects

        public Collection<? extends Object> getObjects​(org.kie.api.runtime.ObjectFilter filter)
        Specified by:
        getObjects in interface org.kie.api.runtime.rule.EntryPoint
      • getSessionClock

        public <T extends org.kie.api.time.SessionClock> T getSessionClock()
        Specified by:
        getSessionClock in interface org.kie.api.runtime.KieRuntime
      • getEntryPoint

        public org.kie.api.runtime.rule.EntryPoint getEntryPoint​(String name)
        Specified by:
        getEntryPoint in interface org.kie.api.runtime.rule.RuleRuntime
      • getEntryPoints

        public Collection<? extends org.kie.api.runtime.rule.EntryPoint> getEntryPoints()
        Specified by:
        getEntryPoints in interface org.kie.api.runtime.rule.RuleRuntime
      • halt

        public void halt()
        Specified by:
        halt in interface org.kie.api.runtime.rule.RuleRuntime
      • insert

        public org.kie.api.runtime.rule.FactHandle insert​(Object object)
        Specified by:
        insert in interface org.kie.api.runtime.rule.EntryPoint
      • submit

        public void submit​(org.kie.api.runtime.KieSession.AtomicAction action)
        Specified by:
        submit in interface org.kie.api.runtime.KieSession
      • getKieRuntime

        public <T> T getKieRuntime​(Class<T> cls)
        Specified by:
        getKieRuntime in interface org.kie.api.runtime.KieSession
      • retract

        public void retract​(org.kie.api.runtime.rule.FactHandle handle)
        Specified by:
        retract in interface org.kie.api.runtime.rule.EntryPoint
      • delete

        public void delete​(org.kie.api.runtime.rule.FactHandle handle)
        Specified by:
        delete in interface org.kie.api.runtime.rule.EntryPoint
      • delete

        public void delete​(org.kie.api.runtime.rule.FactHandle handle,
                           org.kie.api.runtime.rule.FactHandle.State fhState)
        Specified by:
        delete in interface org.kie.api.runtime.rule.EntryPoint
      • update

        public void update​(org.kie.api.runtime.rule.FactHandle handle,
                           Object object)
        Specified by:
        update in interface org.kie.api.runtime.rule.EntryPoint
      • update

        public void update​(org.kie.api.runtime.rule.FactHandle handle,
                           Object object,
                           String... modifiedProperties)
        Specified by:
        update in interface org.kie.api.runtime.rule.EntryPoint
      • addEventListener

        public void addEventListener​(org.kie.api.event.rule.RuleRuntimeEventListener listener)
        Specified by:
        addEventListener in interface org.kie.api.event.rule.RuleRuntimeEventManager
      • addEventListener

        public void addEventListener​(org.kie.api.event.rule.AgendaEventListener listener)
        Specified by:
        addEventListener in interface org.kie.api.event.rule.RuleRuntimeEventManager
      • getAgendaEventListeners

        public Collection<org.kie.api.event.rule.AgendaEventListener> getAgendaEventListeners()
        Specified by:
        getAgendaEventListeners in interface org.kie.api.event.rule.RuleRuntimeEventManager
      • getRuleRuntimeEventListeners

        public Collection<org.kie.api.event.rule.RuleRuntimeEventListener> getRuleRuntimeEventListeners()
        Specified by:
        getRuleRuntimeEventListeners in interface org.kie.api.event.rule.RuleRuntimeEventManager
      • removeEventListener

        public void removeEventListener​(org.kie.api.event.rule.RuleRuntimeEventListener listener)
        Specified by:
        removeEventListener in interface org.kie.api.event.rule.RuleRuntimeEventManager
      • removeEventListener

        public void removeEventListener​(org.kie.api.event.rule.AgendaEventListener listener)
        Specified by:
        removeEventListener in interface org.kie.api.event.rule.RuleRuntimeEventManager
      • addEventListener

        public void addEventListener​(org.kie.api.event.process.ProcessEventListener listener)
        Specified by:
        addEventListener in interface org.kie.api.event.process.ProcessEventManager
      • getProcessEventListeners

        public Collection<org.kie.api.event.process.ProcessEventListener> getProcessEventListeners()
        Specified by:
        getProcessEventListeners in interface org.kie.api.event.process.ProcessEventManager
      • removeEventListener

        public void removeEventListener​(org.kie.api.event.process.ProcessEventListener listener)
        Specified by:
        removeEventListener in interface org.kie.api.event.process.ProcessEventManager
      • getGlobal

        public Object getGlobal​(String identifier)
        Specified by:
        getGlobal in interface org.kie.api.runtime.KieRuntime
      • setGlobal

        public void setGlobal​(String identifier,
                              Object object)
        Specified by:
        setGlobal in interface org.kie.api.runtime.KieRuntime
      • getGlobals

        public org.kie.api.runtime.Globals getGlobals()
        Specified by:
        getGlobals in interface org.kie.api.runtime.KieRuntime
      • getCalendars

        public org.kie.api.runtime.Calendars getCalendars()
        Specified by:
        getCalendars in interface org.kie.api.runtime.KieRuntime
      • getObject

        public Object getObject​(org.kie.api.runtime.rule.FactHandle factHandle)
        Specified by:
        getObject in interface org.kie.api.runtime.rule.EntryPoint
      • getEnvironment

        public org.kie.api.runtime.Environment getEnvironment()
        Specified by:
        getEnvironment in interface org.kie.api.runtime.KieRuntime
      • execute

        public <T> T execute​(org.kie.api.command.Command<T> command)
        Specified by:
        execute in interface org.kie.api.runtime.CommandExecutor
      • getQueryResults

        public org.kie.api.runtime.rule.QueryResults getQueryResults​(String query,
                                                                     Object... arguments)
        Specified by:
        getQueryResults in interface org.kie.api.runtime.rule.RuleRuntime
      • getEntryPointId

        public String getEntryPointId()
        Specified by:
        getEntryPointId in interface org.kie.api.runtime.rule.EntryPoint
      • getFactCount

        public long getFactCount()
        Specified by:
        getFactCount in interface org.kie.api.runtime.rule.EntryPoint
      • openLiveQuery

        public org.kie.api.runtime.rule.LiveQuery openLiveQuery​(String query,
                                                                Object[] arguments,
                                                                org.kie.api.runtime.rule.ViewChangedEventListener listener)
        Specified by:
        openLiveQuery in interface org.kie.api.runtime.rule.RuleRuntime
      • getSessionConfiguration

        public org.kie.api.runtime.KieSessionConfiguration getSessionConfiguration()
        Specified by:
        getSessionConfiguration in interface org.kie.api.runtime.KieRuntime
      • startProcess

        public org.kie.api.runtime.process.ProcessInstance startProcess​(String processId,
                                                                        org.kie.internal.process.CorrelationKey correlationKey,
                                                                        Map<String,​Object> parameters)
        Specified by:
        startProcess in interface org.kie.internal.process.CorrelationAwareProcessRuntime
      • createProcessInstance

        public org.kie.api.runtime.process.ProcessInstance createProcessInstance​(String processId,
                                                                                 org.kie.internal.process.CorrelationKey correlationKey,
                                                                                 Map<String,​Object> parameters)
        Specified by:
        createProcessInstance in interface org.kie.internal.process.CorrelationAwareProcessRuntime
      • getProcessInstance

        public org.kie.api.runtime.process.ProcessInstance getProcessInstance​(org.kie.internal.process.CorrelationKey correlationKey)
        Specified by:
        getProcessInstance in interface org.kie.internal.process.CorrelationAwareProcessRuntime
      • startProcessFromNodeIds

        public org.kie.api.runtime.process.ProcessInstance startProcessFromNodeIds​(String processId,
                                                                                   org.kie.internal.process.CorrelationKey key,
                                                                                   Map<String,​Object> params,
                                                                                   String... nodeIds)
        Specified by:
        startProcessFromNodeIds in interface org.kie.internal.process.CorrelationAwareProcessRuntime
      • startProcessFromNodeIds

        public org.kie.api.runtime.process.ProcessInstance startProcessFromNodeIds​(String processId,
                                                                                   Map<String,​Object> params,
                                                                                   String... nodeIds)
        Specified by:
        startProcessFromNodeIds in interface org.kie.api.runtime.process.ProcessRuntime