Class CommandContext

java.lang.Object
org.flowable.common.engine.impl.interceptor.CommandContext

public class CommandContext extends Object
Author:
Tom Baeyens, Agim Emruli, Joram Barrez
  • Field Details

  • Constructor Details

    • CommandContext

      public CommandContext(Command<?> command)
  • Method Details

    • close

      public void close()
    • logException

      protected void logException()
    • rethrowExceptionIfNeeded

      protected void rethrowExceptionIfNeeded() throws Error
      Throws:
      Error
    • addCloseListener

      public void addCloseListener(CommandContextCloseListener commandContextCloseListener)
    • getCloseListeners

      public List<CommandContextCloseListener> getCloseListeners()
    • executeCloseListenersClosing

      protected void executeCloseListenersClosing()
    • executeCloseListenersAfterSessionFlushed

      protected void executeCloseListenersAfterSessionFlushed()
    • executeCloseListenersClosed

      protected void executeCloseListenersClosed()
    • executeCloseListenersCloseFailure

      protected void executeCloseListenersCloseFailure()
    • flushSessions

      protected void flushSessions()
    • closeSessions

      protected void closeSessions()
    • exception

      public void exception(Throwable exception)
      Stores the provided exception on this CommandContext instance. That exception will be rethrown at the end of closing the CommandContext instance. If there is already an exception being stored, a 'masked exception' message will be logged.
    • resetException

      public void resetException()
    • addAttribute

      public void addAttribute(String key, Object value)
    • getAttribute

      public Object getAttribute(String key)
    • removeAttribute

      public void removeAttribute(String key)
    • getSession

      public <T> T getSession(Class<T> sessionClass)
    • getSessionFactories

      public Map<Class<?>,SessionFactory> getSessionFactories()
    • setSessionFactories

      public void setSessionFactories(Map<Class<?>,SessionFactory> sessionFactories)
    • getEngineConfigurations

      public Map<String,AbstractEngineConfiguration> getEngineConfigurations()
    • setEngineConfigurations

      public void setEngineConfigurations(Map<String,AbstractEngineConfiguration> engineConfigurations)
    • pushEngineCfgToStack

      public void pushEngineCfgToStack(String engineCfgKey)
    • popEngineCfgStack

      public String popEngineCfgStack()
    • isRootUsageOfCurrentEngine

      public boolean isRootUsageOfCurrentEngine()
      Returns:
      Returns whether (at the time of calling this method) the current engine is being executed as the 'root engine'. Or said differently: this will return false when the current engine is being used in a nested Command execution call and will return true if it is the root usage of the current engine. For example: CMMN engine executes process task, that in its turn calls a CMMN task. The hierarchy of engine will be CMMN (a) - BPMN (b) - CMMN (c). If this method is called in the context of (c), false is returned. In the context of (a), true will be returned. For (b), there is but one usage and it will be true.
    • addEngineConfiguration

      public void addEngineConfiguration(String engineKey, String scopeType, AbstractEngineConfiguration engineConfiguration)
    • getCommandExecutor

      public CommandExecutor getCommandExecutor()
    • setCommandExecutor

      public void setCommandExecutor(CommandExecutor commandExecutor)
    • getClassLoader

      public ClassLoader getClassLoader()
    • setClassLoader

      public void setClassLoader(ClassLoader classLoader)
    • isUseClassForNameClassLoading

      public boolean isUseClassForNameClassLoading()
    • setUseClassForNameClassLoading

      public void setUseClassForNameClassLoading(boolean useClassForNameClassLoading)
    • getClock

      public Clock getClock()
    • setClock

      public void setClock(Clock clock)
    • getObjectMapper

      public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
    • setObjectMapper

      public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • getCommand

      public Command<?> getCommand()
    • getSessions

      public Map<Class<?>,Session> getSessions()
    • getException

      public Throwable getException()
    • isReused

      public boolean isReused()
    • setReused

      public void setReused(boolean reused)
    • getResult

      public Object getResult()
    • setResult

      public void setResult(Object result)
    • getStartTime

      public long getStartTime()