Package com.sas.lsaf.workflow.task

## Interface TaskService

-     public interface TaskService

  The service to access the current and completed tasks and elements for an individual process flow.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `assignTask​(java.lang.String taskId, java.lang.String assigneeId)` | Assigns the user task to the specified user.
    `void` | `claimTask​(java.lang.String taskId)` | Claims the user task by assigning the task to the current user.
    `void` | `completeTask​(java.lang.String taskId, float actualHours, java.util.Set<DataProperty> taskCompletionData, java.lang.String comment)` | Completes the user task.
    `java.util.Set<UserTask>` | `getAllCurrentUserTasks()` | Gets all of the user tasks that the user is authorized to access for all active process flows.
    `java.util.Set<CompletedElement>` | `getCompletedElementsByProcessFlow​(java.lang.String processFlowId)` | Gets the completed elements of the process flow with the identifier.
    `java.util.Set<Element>` | `getCurrentElementsByProcessFlow​(java.lang.String processFlowId)` | Gets the current elements of the process flow with the identifier.
    `UserTask` | `getCurrentUserTask​(java.lang.String taskId)` | Gets the user task by the specified unique identifier.
    `java.util.Set<UserTask>` | `getCurrentUserTasks()` | Gets the user tasks that are assigned to the current user and tasks for which the current user is a candidate for all active process flows.
    `int` | `getSearchLimit()` | Gets the maximum number of search results that are returned from a search.
    `UserTaskDetails` | `getUserTaskDetails​(java.lang.String taskId)` | Gets additional user task information, which includes the candidates, data properties, and task assignment history.
    `TaskSearchResults` | `search​(TaskQuery query)` | Searches the process flow tasks, based on the specified query.
    `void` | `startTask​(java.lang.String taskId)` | Starts a user task.
    `UserTaskDetails` | `updateUserTask​(UserTaskUpdateInfo userTask)` | Updates the user task with basic properties as well as details such as candidates and completion properties.

- - ### Method Detail

    - #### getAllCurrentUserTasks

          java.util.Set<UserTask> getAllCurrentUserTasks()
                                                  throws ProcessFlowException

      Gets all of the user tasks that the user is authorized to access for all active process flows.
      Returns:
        The user tasks.
      Throws:
        `ProcessFlowException` - Thrown when there is an issue when getting the tasks.

    - #### getCurrentUserTasks

          java.util.Set<UserTask> getCurrentUserTasks()
                                               throws ProcessFlowException

      Gets the user tasks that are assigned to the current user and tasks for which the current user is a candidate for all active process flows.
      Returns:
        The tasks.
      Throws:
        `ProcessFlowException` - thrown when there is an issue when getting the tasks.

    - #### claimTask

          void claimTask​(java.lang.String taskId)
                  throws TaskNotFoundException,
                         InvalidTaskAssigneeException,
                         InvalidTaskStateException,
                         ProcessFlowException

      Claims the user task by assigning the task to the current user. The task must not have been started (For more information, see: `startTask(String)` and only unassigned tasks can be claimed or assigned.
      Parameters:
        `taskId` - The identifier of the user task.
      Throws:
        `TaskNotFoundException` - Thrown when there is an issue when getting the task.
        `InvalidTaskAssigneeException` - Thrown when there is an issue when assigning the task to the current user.
        `InvalidTaskStateException` - Thrown when the task is not in the proper state to claim.
        `ProcessFlowException` - Thrown when there is an issue when claiming the task.

    - #### getCurrentUserTask

          UserTask getCurrentUserTask​(java.lang.String taskId)
                               throws TaskNotFoundException,
                                      ProcessFlowException

      Gets the user task by the specified unique identifier. Only user tasks that are in a process flow that have been started can be retrieved by this method.
      Parameters:
        `taskId` - The identifier of the task.
      Returns:
        The task.
      Throws:
        `TaskNotFoundException` - Thrown when there is an issue when getting the task.
        `ProcessFlowException` - Thrown when there is an issue when getting the task.

    - #### startTask

          void startTask​(java.lang.String taskId)
                  throws TaskNotFoundException,
                         InvalidTaskStateException,
                         ProcessFlowException

      Starts a user task. A task must be assigned to the current user before it can be started.
      Parameters:
        `taskId` - The identifier of the task.
      Throws:
        `TaskNotFoundException` - Thrown when there is an issue when getting the task.
        `InvalidTaskStateException` - Thrown when the task is not in the proper state to start the task.
        `ProcessFlowException` - Thrown when there is an issue when starting the task.

    - #### assignTask

          void assignTask​(java.lang.String taskId,
                          java.lang.String assigneeId)
                   throws TaskNotFoundException,
                          InvalidTaskStateException,
                          InvalidTaskAssigneeException,
                          ProcessFlowException

      Assigns the user task to the specified user.
      Parameters:
        `taskId` - The identifier of the user task.
        `assigneeId` - The user to whom to assign the user task.
      Throws:
        `TaskNotFoundException` - Thrown when there is an issue when getting the task.
        `InvalidTaskStateException` - Thrown when the task is not in the proper state to assign.
        `InvalidTaskAssigneeException` - Thrown when there is an issue when assigning the task to the specified user.
        `ProcessFlowException` - Thrown when there is an issue when assigning the task.

    - #### completeTask

          void completeTask​(java.lang.String taskId,
                            float actualHours,
                            java.util.Set<DataProperty> taskCompletionData,
                            java.lang.String comment)
                     throws TaskNotFoundException,
                            InvalidTaskStateException,
                            ProcessFlowException

      Completes the user task.
      Parameters:
        `taskId` - The identifier of the user task.
        `actualHours` - The actual hours of work to complete the user task.
        `taskCompletionData` - The data properties to apply upon completion of the task.
        `comment` - The comment regarding the completion of this task.
      Throws:
        `TaskNotFoundException` - Thrown when there is an issue when getting the task.
        `InvalidTaskStateException` - Thrown when the task is not in the proper state to complete.
        `ProcessFlowException` - Thrown when there is an issue when completing the user task.

    - #### getUserTaskDetails

          UserTaskDetails getUserTaskDetails​(java.lang.String taskId)
                                      throws TaskNotFoundException,
                                             ProcessFlowException

      Gets additional user task information, which includes the candidates, data properties, and task assignment history.
      Parameters:
        `taskId` - The identifier of the user task.
      Returns:
        The details.
      Throws:
        `TaskNotFoundException` - Thrown when the user task with the identifier does not exist.
        `ProcessFlowException` - Thrown when there is an issue when getting the user task details.

    - #### getCurrentElementsByProcessFlow

          java.util.Set<Element> getCurrentElementsByProcessFlow​(java.lang.String processFlowId)
                                                          throws ProcessFlowException,
                                                                 ProcessFlowNotFoundException

      Gets the current elements of the process flow with the identifier. Only process flows that have been started will have current elements. This will return elements of any type that are current in the process flow which can include user tasks and system task as well as non-task elements such as signals and events.
      Parameters:
        `processFlowId` - the identifier of the process flow.
      Returns:
        the current process flow elements.
      Throws:
        `ProcessFlowException` - thrown when there is an issue getting the process flow task.
        `ProcessFlowNotFoundException` - thrown when the process flow with the identifier does not exist.

    - #### getCompletedElementsByProcessFlow

          java.util.Set<CompletedElement> getCompletedElementsByProcessFlow​(java.lang.String processFlowId)
                                                                     throws ProcessFlowException,
                                                                            ProcessFlowNotFoundException

      Gets the completed elements of the process flow with the identifier.
      Parameters:
        `processFlowId` - The identifier of the process flow.
      Returns:
        The completed process flow elements.
      Throws:
        `ProcessFlowException` - Thrown when there is an issue when getting the process flow elements.
        `ProcessFlowNotFoundException` - Thrown when the process flow with the identifier does not exist.

    - #### search

          TaskSearchResults search​(TaskQuery query)
                            throws TaskSearchException

      Searches the process flow tasks, based on the specified query. The default search limit is 5000.
      Parameters:
        `query` - The criteria to query the process flow tasks.
      Returns:
        The results of the search.
      Throws:
        `TaskSearchException` - Thrown when there is an issue when searching process flows.

    - #### getSearchLimit

          int getSearchLimit()

      Gets the maximum number of search results that are returned from a search. The default search limit is 5000.
      Returns:
        The maximum number.

    - #### updateUserTask

          UserTaskDetails updateUserTask​(UserTaskUpdateInfo userTask)
                                  throws TaskNotFoundException,
                                         InvalidTaskAssigneeException,
                                         InvalidTaskStateException,
                                         ProcessFlowException

      Updates the user task with basic properties as well as details such as candidates and completion properties.
      Parameters:
        `userTask` - The user task details to update.
      Returns:
        The details.
      Throws:
        `TaskNotFoundException` - Thrown when there is an issue getting the task.
        `InvalidTaskAssigneeException` - Thrown when there is an issue when updating the user task with the specified assignee or candidates.
        `InvalidTaskStateException` - Thrown when the task is not in the proper state to be updated.
        `ProcessFlowException` - Thrown when there is an issue when updating the process flow elements.