Class PerProcessInstanceRuntimeManager

  • All Implemented Interfaces:
    org.kie.api.runtime.manager.RuntimeManager, org.kie.internal.runtime.manager.InternalRuntimeManager

    public class PerProcessInstanceRuntimeManager
    extends AbstractRuntimeManager
    A RuntimeManager implementation that is backed by the "Per Process Instance" strategy. This means that every process instance will be bound to a ksession for it's entire life time. Once started, whenever other operations are invoked, this manager will ensure that the correct ksession will be provided.
    This also applies to sub processes (reusable sub processes) that create new process instances: the sub process instance will have its own ksession independent of the parent one.
    This manager will ensure that as soon as the process instance completes, the ksession will be disposed of and destroyed.
    This implementation supports the following Context implementations:
    • ProcessInstanceIdContext
    • CorrelationKeyContext
    • EmptyContext - for initial RuntimeEngine to start process only
    • Constructor Detail

      • PerProcessInstanceRuntimeManager

        public PerProcessInstanceRuntimeManager​(org.kie.api.runtime.manager.RuntimeEnvironment environment,
                                                org.kie.internal.runtime.manager.SessionFactory factory,
                                                org.kie.internal.runtime.manager.TaskServiceFactory taskServiceFactory,
                                                String identifier)
    • Method Detail

      • getRuntimeEngine

        public org.kie.api.runtime.manager.RuntimeEngine getRuntimeEngine​(org.kie.api.runtime.manager.Context<?> context)
      • signalEvent

        public void signalEvent​(String type,
                                Object event)
      • disposeRuntimeEngine

        public void disposeRuntimeEngine​(org.kie.api.runtime.manager.RuntimeEngine runtime)
      • softDispose

        public void softDispose​(org.kie.api.runtime.manager.RuntimeEngine runtimeEngine)
        Description copied from class: AbstractRuntimeManager
        Soft dispose means it will be invoked as sort of preparation step before actual dispose. Mainly used with transaction synchronization to be invoked as part of beforeCompletion to clean up any thread state - like thread local settings as afterCompletion can be invoked from another thread
        Overrides:
        softDispose in class AbstractRuntimeManager
      • close

        public void close()
        Specified by:
        close in interface org.kie.api.runtime.manager.RuntimeManager
        Overrides:
        close in class AbstractRuntimeManager
      • validate

        public boolean validate​(Long ksessionId,
                                Long processInstanceId)
      • setFactory

        public void setFactory​(org.kie.internal.runtime.manager.SessionFactory factory)
      • getTaskServiceFactory

        public org.kie.internal.runtime.manager.TaskServiceFactory getTaskServiceFactory()
      • setTaskServiceFactory

        public void setTaskServiceFactory​(org.kie.internal.runtime.manager.TaskServiceFactory taskServiceFactory)
      • getMapper

        public org.kie.internal.runtime.manager.Mapper getMapper()
      • setMapper

        public void setMapper​(org.kie.internal.runtime.manager.Mapper mapper)
      • findLocalRuntime

        protected org.kie.api.runtime.manager.RuntimeEngine findLocalRuntime​(Object processInstanceId)
      • saveLocalRuntime

        protected void saveLocalRuntime​(Object processInstanceId,
                                        org.kie.api.runtime.manager.RuntimeEngine runtime)
      • removeLocalRuntime

        protected void removeLocalRuntime​(org.kie.api.runtime.manager.RuntimeEngine runtime)
      • activate

        public void activate()
        Specified by:
        activate in interface org.kie.internal.runtime.manager.InternalRuntimeManager
        Overrides:
        activate in class AbstractRuntimeManager
      • deactivate

        public void deactivate()
        Specified by:
        deactivate in interface org.kie.internal.runtime.manager.InternalRuntimeManager
        Overrides:
        deactivate in class AbstractRuntimeManager