Class 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
    • Constructor Detail

    • Method Detail

      • abort

        public void abort​(IUserData userData,
                          IProcessCaseUpdates updates)
                   throws AppException
        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.
        Throws:
        AppException - This exception is thrown when the task could not be aborted.
      • 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)
                      throws AppException
        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.
        Throws:
        AppException - This exception is thrown when the current task could not be marked as completed.
      • evaluateAfterComplete

        public void evaluateAfterComplete​(IUserData userData,
                                          String taskExit,
                                          ProcessCase 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)
                   throws ProcessException
        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.
        Throws:
        ProcessException
      • 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
      • getCaseId

        public long getCaseId()
        Description copied from interface: IProcessTask
        This method returns the ID of the case the task is defined for.
        Specified by:
        getCaseId 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.
      • 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.
      • 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.
      • completeTask

        protected void completeTask​(IUserData userData)
      • cancelTask

        protected void cancelTask​(IUserData userData)
      • unscheduleJob

        protected void unscheduleJob​(IUserData userData)
      • unscheduleJobWithAdvancedScheduler

        protected void unscheduleJobWithAdvancedScheduler​(IUserData userData)
      • unscheduleJobWithCaseEngine

        protected void unscheduleJobWithCaseEngine​(IUserData userData)
      • updateInternalTaskModel

        protected void updateInternalTaskModel()
      • 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
      • 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