Class ProcessTask

java.lang.Object
com.aquima.interactions.process.impl.ProcessTask
All Implemented Interfaces:
IProcessTask

public class ProcessTask extends Object implements IProcessTask
Class exposing process engine functionality for a task.
Since:
7.1
Author:
Jon van Leuven
  • Field Details

  • Constructor Details

  • Method Details

    • abort

      public void abort(IUserData userData, IProcessCaseUpdates updates)
      Description copied from interface: IProcessTask
      This method may be invoked to indicate the process step has been aborted. The abort method may be manually invoked, but can also be invoked by a session that has been closed. This method is also known as "cancel task" in the documentation.
      Specified by:
      abort in interface IProcessTask
      Parameters:
      userData - User that aborts the execution of the task.
      updates - Object containing updates that should be applied to the case data.
    • cancel

      public void cancel(IUserData userData)
      Description copied from interface: IProcessTask
      This method may be used to explicitly cancel the task. Canceling a task may only be done for tasks that are not part of a process definition. Canceling the task will remove the task, and should not be confused with the abort task method.
      Specified by:
      cancel in interface IProcessTask
      Parameters:
      userData - User that aborts the execution of the task.
    • complete

      public void complete(IUserData userData, IProcessCaseUpdates updates, String taskExit)
      Description copied from interface: IProcessTask
      This method may be invoked to indicate the process step has been successfully completed. The complete operation will unlock the case again, and merge the updates from the process step with the case data. This method is also known as "close task" in the documentation.
      Specified by:
      complete in interface IProcessTask
      Parameters:
      userData - User that marks the task as completed.
      updates - Object containing updates that should be applied to the case data.
      taskExit - The exit state of the completed task, may be null.
    • evaluateAfterComplete

      public void evaluateAfterComplete(IUserData userData, String taskExit, IProcessCase processCase)
      Description copied from interface: IProcessTask
      Evaluates the case after a task has been completed
      Specified by:
      evaluateAfterComplete in interface IProcessTask
      Parameters:
      userData - user that marks the task as completed
      taskExit - the exit state of the completed task
      processCase - the case which is evaluated
    • start

      public void start(IUserData userData)
      Description copied from interface: IProcessTask
      This method will attempt to mark the process step as started for the current user. The start operation may fail if another process has updated the case, or started another task, in the time between acquiring the task and starting it. When the start method has completed without an exception, the case will be locked by the current user, and the either the complete or abort method should be invoked to release it.
      Specified by:
      start in interface IProcessTask
      Parameters:
      userData - User that will start the task.
    • isCaseLockingEnabled

      protected boolean isCaseLockingEnabled()
    • traceTaskOffline

      public void traceTaskOffline(IUserData userData)
    • hasPermissionsToExecute

      protected boolean hasPermissionsToExecute(IUserData userData)
    • getAssigneeInfo

      public IAssigneeInfo getAssigneeInfo()
      Description copied from interface: IProcessTask
      This method returns the AssigneeInfo of whom the task is assigned to.
      Specified by:
      getAssigneeInfo in interface IProcessTask
      Returns:
      the AssigneeInfo of whom the task is assigned to.
    • getPriority

      public Integer getPriority()
      Description copied from interface: IProcessTask
      This method returns the priority of a task.
      Specified by:
      getPriority in interface IProcessTask
      Returns:
      The priority
    • getExecutedBy

      public String getExecutedBy()
      Description copied from interface: IProcessTask
      Gets the name of the user that executed this task.
      Specified by:
      getExecutedBy in interface IProcessTask
      Returns:
      Username
    • getProcessId

      public long getProcessId()
      Description copied from interface: IProcessTask
      This method returns the ID of the process the task is defined for.
      Specified by:
      getProcessId in interface IProcessTask
      Returns:
      The ID of the case the task is defined for.
    • getTimeoutDate

      public DateTimeValue getTimeoutDate()
      Description copied from interface: IProcessTask
      this method returns the date at which the task will expire
      Specified by:
      getTimeoutDate in interface IProcessTask
      Returns:
      The date at which the task will expire
    • getId

      public long getId()
      Description copied from interface: IProcessTask
      This method returns the unique ID of this task.
      Specified by:
      getId in interface IProcessTask
      Returns:
      the unique ID of this process step.
    • getNodeId

      public GUID getNodeId()
      Description copied from interface: IProcessTask
      This method returns the optional node ID this task belongs to.
      Specified by:
      getNodeId in interface IProcessTask
      Returns:
      the node ID of this task.
    • getName

      public String getName()
      Description copied from interface: IProcessTask
      This method returns the name of the task as present in the task definition.
      Specified by:
      getName in interface IProcessTask
      Returns:
      The name of the task.
    • getDescription

      public String getDescription()
      Description copied from interface: IProcessTask
      This method returns an optional description of the task.
      Specified by:
      getDescription in interface IProcessTask
      Returns:
      Description of the task
    • getStartDate

      public DateTimeValue getStartDate()
      Description copied from interface: IProcessTask
      This method returns the date at which the task may start.
      Specified by:
      getStartDate in interface IProcessTask
      Returns:
      The date at which the task may start.
    • setStartDate

      public void setStartDate(DateTimeValue startDate)
      Description copied from interface: IProcessTask
      This method may be used to change the start date of the task.
      Specified by:
      setStartDate in interface IProcessTask
      Parameters:
      startDate - The new timeout date for the task.
    • getStatus

      public TaskStatusType getStatus()
      Description copied from interface: IProcessTask
      This method returns the current status of the task.
      Specified by:
      getStatus in interface IProcessTask
      Returns:
      the current status of the task.
    • assign

      public void assign(IUserData userData, IAssigneeInfo assigneeInfo, boolean isUserSet)
      Description copied from interface: IProcessTask
      This method may be used to assign the task.
      Specified by:
      assign in interface IProcessTask
      Parameters:
      userData - Object containing information about the current user.
      assigneeInfo - The AssigneeInfo of who the task should be assigned to.
      isUserSet - is user set
    • setTimeoutDate

      public void setTimeoutDate(IUserData userData, DateTimeValue timeoutDate)
      Description copied from interface: IProcessTask
      This method may be used to change the timeout date of the task. Adjusting the timeout date of the task may cause the task to be aborted.
      Specified by:
      setTimeoutDate in interface IProcessTask
      Parameters:
      userData - Object containing information about the current user.
      timeoutDate - The new timeout date for the task.
    • getDueDate

      public DateTimeValue getDueDate()
      Description copied from interface: IProcessTask
      this method returns the date at which the task should be completed.
      Specified by:
      getDueDate in interface IProcessTask
      Returns:
      The date at which the task should be completed.
    • unassign

      public void unassign()
      Description copied from interface: IProcessTask
      This method may be used to clear the assignment information of the task.
      Specified by:
      unassign in interface IProcessTask
    • completeTask

      protected void completeTask(IUserData userData)
    • cancelTask

      protected void cancelTask(IUserData userData)
    • updateInternalTaskModel

      protected void updateInternalTaskModel()
    • evaluateRequiredRoles

      public IRole[] evaluateRequiredRoles()
      Description copied from interface: IProcessTask
      This method returns the required roles to start this task.
      Specified by:
      evaluateRequiredRoles in interface IProcessTask
      Returns:
      The required roles.
    • getCustomFieldValue

      public String getCustomFieldValue(String name)
      Description copied from interface: IProcessTask
      This method returns the value of a custom field
      Specified by:
      getCustomFieldValue in interface IProcessTask
      Parameters:
      name - the custom field name
      Returns:
      null if the field does not exist or has no value for this task
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getTask

      public ITaskModel getTask()
    • getDisplayNameValues

      protected Map<String,String> getDisplayNameValues(ITaskModel task, IProcessCase processCase)
    • isUserSet

      public boolean isUserSet()
      Specified by:
      isUserSet in interface IProcessTask
      Returns:
      whether the assignee of the task is set manually by an user or by routing algorithm
    • getDisplayName

      public IMultilingualText getDisplayName()
      Description copied from interface: IProcessTask
      Returns the IMultilingualText display name for the task.
      Specified by:
      getDisplayName in interface IProcessTask
      Returns:
      display name for the task