Class ReadonlyProcessEngine

java.lang.Object
com.aquima.interactions.process.wrapper.ProcessEngineDelegate
com.aquima.interactions.process.wrapper.ReadonlyProcessEngine
All Implemented Interfaces:
IProcessData, IProcessEngine, IProcessEngineBehavior, IProcessEngineDefinitions, IProcessExpressionHandler

public class ReadonlyProcessEngine extends ProcessEngineDelegate
Decorator class that wraps a process engine to make it immutable (read-only).
Since:
7.1
Author:
Jon van Leuven
  • Field Details

  • Constructor Details

    • ReadonlyProcessEngine

      public ReadonlyProcessEngine(IProcessEngine processEngine)
      Constructs a read-only wrapper for the specified process engine.
      Parameters:
      processEngine - The process engine that should be wrapped in this read-only decorator.
  • Method Details

    • evaluateTimer

      public void evaluateTimer(DateTimeValue currentTime)
      Always throws an InvalidStateException: No modifications allowed on a read only process engine.
      Specified by:
      evaluateTimer in interface IProcessEngineBehavior
      Overrides:
      evaluateTimer in class ProcessEngineDelegate
      Parameters:
      currentTime - The current time.
    • reopenTask

      public void reopenTask(long taskId)
      Always throws an InvalidStateException: No modifications allowed on a read only process engine.
      Parameters:
      taskId - the id of the task to be re-opened
    • reopenTask

      public void reopenTask(long taskId, IUserData userData)
      Always throws an InvalidStateException: No modifications allowed on a read only process engine.
      Parameters:
      taskId - the id of the task to be re-opened
      userData - the data of the current user
    • replayMessageEvent

      public long replayMessageEvent(long eventId, Long caseId)
      Always throws an InvalidStateException: No modifications allowed on a read only process engine.
      Parameters:
      eventId - the id of the original message event which should be replayed
      caseId - the optional ID of the case in which the message event will be replayed (if null, the message event will be broadcast to all waiting cases)
      Returns:
      the id of the newly created event
    • replayMessageEvent

      public long replayMessageEvent(long eventId, Long caseId, IUserData userData)
      Always throws an InvalidStateException: No modifications allowed on a read only process engine.
      Parameters:
      eventId - the id of the original message event which should be replayed
      caseId - the optional ID of the case in which the message event will be replayed (if null, the message event will be broadcast to all waiting cases)
      userData - the data of the current user
      Returns:
      the id of the newly created event
    • replayTimerEvent

      public long replayTimerEvent(long eventId)
      Always throws an InvalidStateException: No modifications allowed on a read only process engine.
      Parameters:
      eventId - the id of the original timer event which should be replayed
      Returns:
      the id of the newly created event
    • replayTimerEvent

      public long replayTimerEvent(long eventId, IUserData userData)
      Always throws an InvalidStateException: No modifications allowed on a read only process engine.
      Parameters:
      eventId - the id of the original timer event which should be replayed
      userData - the data of the current user
      Returns:
      the id of the newly created event
    • getAvailableCases

      public IProcessCase[] getAvailableCases(IUserData userData)
      Description copied from interface: IProcessData
      This method will return an array containing the cases that are available for the supplied user.
      Specified by:
      getAvailableCases in interface IProcessData
      Overrides:
      getAvailableCases in class ProcessEngineDelegate
      Parameters:
      userData - Object containing the information about the current user.
      Returns:
      an array containing the cases that are available for the supplied user.
    • getAvailableTasks

      public IProcessTask[] getAvailableTasks(IUserData userData, Long caseId)
      Description copied from interface: IProcessData
      This method returns an array containing the tasks that are available for the supplied user. This method is also known as the "tasks for me" in the documentation.
      Specified by:
      getAvailableTasks in interface IProcessData
      Overrides:
      getAvailableTasks in class ProcessEngineDelegate
      Parameters:
      userData - The data of the user to which the task must be assigned.
      caseId - ID of the case to which the tasks must belong.
      Returns:
      an array containing the tasks for the supplied user.
    • findTasks

      public IProcessTaskView[] findTasks(TaskCriteria taskFilter)
      Description copied from interface: IProcessData
      This method returns an array containing views of all tasks that are valid after applying the filters from the filter context.
      Specified by:
      findTasks in interface IProcessData
      Overrides:
      findTasks in class ProcessEngineDelegate
      Parameters:
      taskFilter - TaskFilterContext to filter the tasks that are returned.
      Returns:
      an array containing the task views.
    • findCases

      public IProcessCaseView[] findCases(CaseCriteria caseFilter)
      Description copied from interface: IProcessData
      This method returns an array containing views of all cases that are valid after applying the filters from the filter context
      Specified by:
      findCases in interface IProcessData
      Overrides:
      findCases in class ProcessEngineDelegate
      Parameters:
      caseFilter - CaseFilterContext to filter the cases that are returned.
      Returns:
      an array containing the case views
    • getRoutingAlgorithm

      public IRoutingAlgorithmDefinition getRoutingAlgorithm(String name)
      Description copied from interface: IProcessEngineDefinitions
      This method returns the routing algorithm definition for the specified name.
      Parameters:
      name - The name of the routing algorithm whose definition is requested.
      Returns:
      The definition of the routing algorithm with the specified name.
    • getPriorityAlgorithm

      public IPriorityAlgorithmDefinition getPriorityAlgorithm(String name)
      Description copied from interface: IProcessEngineDefinitions
      This method returns the definition of an priority algorithm.
      Parameters:
      name - The name of the algorithm.
      Returns:
      The definition of the algorithm.
    • getCase

      public IProcessCase getCase(long caseId)
      Description copied from interface: IProcessData
      This method returns the case for the specified ID.
      Specified by:
      getCase in interface IProcessData
      Overrides:
      getCase in class ProcessEngineDelegate
      Parameters:
      caseId - The ID of the requested case.
      Returns:
      The case for the specified ID.
    • findWaitingCases

      public ICaseModel[] findWaitingCases(String messageEventName, Set<Long> specificCaseIds)
      Description copied from interface: IProcessData
      This method returns the cases waiting for a message event.
      Specified by:
      findWaitingCases in interface IProcessData
      Overrides:
      findWaitingCases in class ProcessEngineDelegate
      Parameters:
      messageEventName - The message event name, may not be null.
      specificCaseIds - A set of case ids, may be null. If not null, only those cases are processed.
      Returns:
      The case models waiting for the message event.
    • getUnassignedTasks

      public IProcessTask[] getUnassignedTasks()
      Description copied from interface: IProcessData
      This method returns an array containing all the tasks that have not yet been assigned.
      Specified by:
      getUnassignedTasks in interface IProcessData
      Overrides:
      getUnassignedTasks in class ProcessEngineDelegate
      Returns:
      an array containing all the tasks that have not yet been assigned.
    • getTask

      public IProcessTask getTask(long taskId)
      Description copied from interface: IProcessData
      This method returns the task for the specified ID.
      Specified by:
      getTask in interface IProcessData
      Overrides:
      getTask in class ProcessEngineDelegate
      Parameters:
      taskId - The ID of the requested task.
      Returns:
      The task for the specified ID.
    • getTaskModel

      public ITaskModel getTaskModel(long taskId)
      Description copied from interface: IProcessData
      This method returns the task for the specified ID.
      Parameters:
      taskId - The ID of the requested task.
      Returns:
      The task for the specified ID.
    • wrapReadonly

      protected static IProcessCase[] wrapReadonly(IProcessCase[] processCases)
    • wrapReadonly

      protected static IProcessCase wrapReadonly(IProcessCase processCase)
    • wrapReadonly

      protected static IProcessTask[] wrapReadonly(IProcessTask[] processTasks)
    • wrapReadonly

      protected static IProcessTask wrapReadonly(IProcessTask processTask)
    • registerDelegate

      public void registerDelegate(IProcessTaskDelegate processTaskDelegate)
      Description copied from interface: IProcessEngine
      This method can be used to register a handler that is able to handle certain tasks (for example handling of automatic tasks).
      Parameters:
      processTaskDelegate - The delegate that is used for certain tasks (like automatic tasks).
    • registerCaseEvaluator

      public void registerCaseEvaluator(ICaseEvaluator evaluator)
      Description copied from interface: IProcessEngine
      Registers a case evaluator that will be used by this process engine to evaluate cases in the background.
      Parameters:
      evaluator - the new evaluator (not null)
    • cancelStartedTasks

      public void cancelStartedTasks()
      Description copied from interface: IProcessEngineBehavior
      This method may be used to cancel started tasks that were abandoned, for example due to an unexpected server shutdown
    • evaluateIMultilingualText

      public IMultilingualText evaluateIMultilingualText(IMultilingualText displayNameContent, IProfile profile)
      Description copied from interface: IProcessExpressionHandler
      This method checks a IMultilingualText to see if there are any TSL expressions. If there are, it will return back a new IMultilingualText with the TSL expressions evaluated and the rest of the text will remain the same
      Specified by:
      evaluateIMultilingualText in interface IProcessExpressionHandler
      Overrides:
      evaluateIMultilingualText in class ProcessEngineDelegate
      Parameters:
      displayNameContent - the multi lingual display name
      profile - the profile
      Returns:
      IMultilingualText with the TSL values evaluated
    • getCaseState

      public ICaseStateModel getCaseState(long caseId)
      Description copied from interface: IProcessData
      Gets the case state
      Parameters:
      caseId - the case ID
      Returns:
      the case state