Class ProcessEngineDelegate

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

public abstract class ProcessEngineDelegate extends Object implements IProcessEngine
Utility class to allow for easy wrapping of a process engine implementation. This an internal class.
Since:
7.1
Author:
Jon van Leuven
  • Constructor Details

    • ProcessEngineDelegate

      protected ProcessEngineDelegate(IProcessEngine processEngine)
  • Method Details

    • closeCase

      public void closeCase(IUserData userData, long caseId)
      Description copied from interface: IProcessEngineBehavior
      This method may be used to close an existing case and cancel all its tasks.
      Specified by:
      closeCase in interface IProcessEngineBehavior
      Parameters:
      userData - Object containing information about the current user.
      caseId - The ID of the case that should be closed.
    • 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
      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
      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
      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
      Parameters:
      caseFilter - CaseFilterContext to filter the cases that are returned.
      Returns:
      an array containing the case views
    • 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
      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
      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.
    • getCaseModel

      public IMetaModel getCaseModel()
      Description copied from interface: IProcessEngineDefinitions
      This method returns the model that is used by the process engine to store case data.
      Specified by:
      getCaseModel in interface IProcessEngineDefinitions
      Returns:
      the model that is used by the process engine to store case data.
    • getCaseProcesses

      public IProcessDefinition[] getCaseProcesses()
      Description copied from interface: IProcessEngineDefinitions
      This method returns an array containing the processes that may be executed to create a new case in the process engine. The user data is used to determine the processes which may actually be executed by the provided user.
      Specified by:
      getCaseProcesses in interface IProcessEngineDefinitions
      Returns:
      Array containing the processes that may be executed to create a new case.
    • getRoles

      public IRole[] getRoles()
      Description copied from interface: IProcessEngineDefinitions
      This method returns all available roles.
      Specified by:
      getRoles in interface IProcessEngineDefinitions
      Returns:
      an array containing all the roles, never null.
    • getProcessByName

      public IProcessDefinition getProcessByName(String name)
      Description copied from interface: IProcessEngineDefinitions
      This method returns the process definition for the specified name.
      Specified by:
      getProcessByName in interface IProcessEngineDefinitions
      Parameters:
      name - The name of the requested process definition.
      Returns:
      The process definition for the specified name.
    • 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
      Parameters:
      taskId - The ID of the requested task.
      Returns:
      The task for the specified ID.
    • getTaskByName

      public IProcessTaskDefinition getTaskByName(String name)
      Description copied from interface: IProcessEngineDefinitions
      This method returns the task definition for the specified name. When a task is loaded from the database (e.g. retrieved from the DAO), use the method IProcessEngineDefinitions.getProcessTaskDefinition(GUID) instead, as that method takes renames of tasks in the current model into account. This method does not. It should therefore only be used for retrieving task definitions on task names that are loaded from the current model, such as task mappings.
      Specified by:
      getTaskByName in interface IProcessEngineDefinitions
      Parameters:
      name - The name of the requested process task.
      Returns:
      The process task definition for the specified name.
    • getProcessTaskDefinition

      public IProcessTaskDefinition getProcessTaskDefinition(GUID nodeId)
      Description copied from interface: IProcessEngineDefinitions
      This method retrieves the task definition for the specified node id. It is required that the node id corresponds to a task node. In Studio, the node id of a task node is knows as the persistency id (note that the node id is a GUID of the persistency id). This method should be used in favor of the IProcessEngineDefinitions.getTaskByName(String) method whenever a task is loaded from the database (e.g. retrieved from the DAO), because it takes into account the use case that a task that is stored in the database is renamed in the current model
      Specified by:
      getProcessTaskDefinition in interface IProcessEngineDefinitions
      Parameters:
      nodeId - the id of the task node, which is a GUID of the persistency id in Studio
      Returns:
      the process task definition for the specified node id
    • 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
      Returns:
      an array containing all the tasks that have not yet been assigned.
    • getProcessEventByName

      public IProcessEventDefinition getProcessEventByName(String eventName)
      Description copied from interface: IProcessEngineDefinitions
      This method returns the event definition for the specified name.
      Specified by:
      getProcessEventByName in interface IProcessEngineDefinitions
      Parameters:
      eventName - The name of the event whose definition is requested.
      Returns:
      The definition of the event with the specified name.
    • getRoutingAlgorithmByName

      public IRoutingAlgorithmDefinition getRoutingAlgorithmByName(String routingAlgorithmName)
    • getPriorityAlgorithmByName

      public IPriorityAlgorithmDefinition getPriorityAlgorithmByName(String priorityAlgorithmName)
    • getAuthorizationAlgorithm

      public IAuthorizationAlgorithmDefinition getAuthorizationAlgorithm(String name)
      Description copied from interface: IProcessEngineDefinitions
      This method returns the definition of an authorization algorithm.
      Specified by:
      getAuthorizationAlgorithm in interface IProcessEngineDefinitions
      Parameters:
      name - The name of the algorithm.
      Returns:
      The definition of the algorithm.
    • getTypeByName

      public ProcessTypeDefinition getTypeByName(String typeName)
      Specified by:
      getTypeByName in interface IProcessEngineDefinitions
    • evaluateTimer

      public void evaluateTimer(DateTimeValue currentTime)
      Description copied from interface: IProcessEngineBehavior
      This method (re)evaluates all open timer tasks.
      Specified by:
      evaluateTimer in interface IProcessEngineBehavior
      Parameters:
      currentTime - The current time.
    • getExpressionParser

      public IExpressionParser getExpressionParser()
      Description copied from interface: IProcessEngineDefinitions
      This method returns the expression parser used by the process engine.
      Specified by:
      getExpressionParser in interface IProcessEngineDefinitions
      Returns:
      The expression parser, never null.
    • getMessageEventByName

      public IMessageEventDefinition getMessageEventByName(String eventName)
      Description copied from interface: IProcessEngineDefinitions
      This method returns the message event definition for the specified name.
      Specified by:
      getMessageEventByName in interface IProcessEngineDefinitions
      Parameters:
      eventName - The name of the event whose definition is requested, may not be null.
      Returns:
      The definition of the message event with the specified name.
    • notifyEvent

      public void notifyEvent(IMessageEvent messageEvent, IUserData user, IProcessCaseChangeListener listener)
      Description copied from interface: IProcessEngineBehavior
      This method notifies the process engine about an event.
      Specified by:
      notifyEvent in interface IProcessEngineBehavior
      Parameters:
      messageEvent - The message event, may not be null.
      user - The user, may not be null.
      listener - A listener to trace the modified cases, may be null.
    • notifyEvent

      public void notifyEvent(IMessageEvent messageEvent, IUserData user, IProcessCaseChangeListener listener, Set<Long> specificCaseIds)
      Description copied from interface: IProcessEngineBehavior
      This method notifies the process engine about an event.
      Specified by:
      notifyEvent in interface IProcessEngineBehavior
      Parameters:
      messageEvent - The message event, may not be null.
      user - The user, may not be null.
      listener - A listener to trace the modified cases, may be null.
      specificCaseIds - A set of case ids, may be null. If not null, only those cases are processed.
    • getNodeIds

      public GUID[] getNodeIds()
      Description copied from interface: IProcessEngineDefinitions
      This method returns all node id.
      Specified by:
      getNodeIds in interface IProcessEngineDefinitions
      Returns:
      The node ids, never null.
    • getNodeDefinition

      public IProcessNodeDefinition getNodeDefinition(GUID nodeId)
      Description copied from interface: IProcessEngineDefinitions
      This method returns the process node definition by the specified node id.
      Specified by:
      getNodeDefinition in interface IProcessEngineDefinitions
      Parameters:
      nodeId - The node id, may not be null
      Returns:
      The node definition, never null.
    • getProcessSettings

      public ProcessSettings getProcessSettings()
      Description copied from interface: IProcessEngine
      Returns the settings used by the process engine, case lists and work lists.
      Specified by:
      getProcessSettings in interface IProcessEngine
      Returns:
      the process settings
    • findByCriteria

      public TaskViewResult findByCriteria(TaskViewCriteria criteria)
      Description copied from interface: IProcessData
      Find task views based on the specified criteria.

      This method alters the criteria by enabling or disabling checking for restriced users depending on the ignore mode setting of the criteria and on whether any authorization algorithms use the 2-man rule. If the Application ID is not ignored, and no authorization algorithm in this process engine uses the 2-man rule, then checking for restricted users is disabled.

      For an equivalent method which does not alter the criteria, see IProcessCaseDao.findByCriteria(TaskViewCriteria).

      Specified by:
      findByCriteria in interface IProcessData
      Parameters:
      criteria - the task criteria to search for
      Returns:
      TaskViewResult the tasks matching the criteria
    • findByCriteria

      public CaseViewResult findByCriteria(CaseViewCriteria criteria)
      Description copied from interface: IProcessData
      Find case views based on the specified criteria.
      Specified by:
      findByCriteria in interface IProcessData
      Parameters:
      criteria - the case criteria to search for
      Returns:
      CaseViewResult the cases matching the criteria
    • 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
      Parameters:
      displayNameContent - the multi lingual display name
      profile - the profile
      Returns:
      IMultilingualText with the TSL values evaluated
    • getCaseEvaluator

      public ICaseEvaluator getCaseEvaluator()
      Description copied from interface: IProcessEngine
      Returns the case evaluator currently used by this process engine.

      NOTE: in future versions, the case evaluator will be replaced with a job scheduler.

      Specified by:
      getCaseEvaluator in interface IProcessEngine
      Returns:
      the currently used case evaluator (not null).