Interface TaskManager


  • @ProviderType
    public interface TaskManager
    TaskManager defines the task management API.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void completeTask​(java.lang.String taskId, java.lang.String actionId)
      Completes the task with the given id and action.
      Task createTask​(Task task)
      Creates a task.
      Task createTask​(java.lang.String parentTaskId, Task task)
      Creates a subtask under the specified parentTaskid
      void deleteTask​(java.lang.String taskId)
      Deletes the task with the given task ID.
      Task getTask​(java.lang.String taskId)
      Retrieves a fully populated task instance for the given task id.
      Task getTask​(java.lang.String taskId, boolean retrieveSubTasks)
      Retrieves the task identified by taskId and opotionally retrieves the task's subtasks.
      Task getTaskByUUID​(java.lang.String taskUUID)
      Retrieves a fully populated task instance for the given task id.
      TaskManagerFactory getTaskManagerFactory()
      Returns a task manager factory to instantiate various objects of the taskmanager interface like Task and TaskAction.
      java.util.Iterator<Task> getTasks​(Filter filter)
      Same as calling getTasks(Filter, int, int) with startIndex of 0, and length of -1 Used as a convenience for calls that do not need to limit the number of tasks being returned
      java.util.Iterator<Task> getTasks​(Filter filter, int startIndex, int length)
      returns all tasks for the specified task type, or all tasks if no tasktype specified.
      Task saveTask​(Task task)
      Saves the given task instance.
      void terminateTask​(java.lang.String taskId)
      Terminates the task
    • Method Detail

      • createTask

        Task createTask​(Task task)
                 throws TaskManagerException
        Creates a task. note that if no task id is provided one will be created and assigned to the resulting task. Optionally if a task id is provided then the task id will be used for the new task unless that task id exists already in the system in which case an exception will be thrown for the duplicate task id.
        Parameters:
        task - Task to create
        Returns:
        newly created task instance
        Throws:
        TaskManagerException - An error occurred creating the task.
      • getTasks

        java.util.Iterator<Task> getTasks​(Filter filter,
                                          int startIndex,
                                          int length)
                                   throws TaskManagerException
        returns all tasks for the specified task type, or all tasks if no tasktype specified.
        Tasks assigned to the currently logged in user are returned. Note that a task's subtasks are not populated by this method.
        Parameters:
        filter - Only tasks matching the conditions in this filter are returned in the resulting iterator.
        startIndex - The index of the first task returned. This value must be > 0
        length - The maximum number of tasks returned. This value must be non-zero. A negative value indicates all results are to be returned
        Returns:
        tasks matching the filter and paging information.
        Throws:
        TaskManagerException - An error occurred retrieving the tasks.
      • getTasks

        java.util.Iterator<Task> getTasks​(Filter filter)
                                   throws TaskManagerException
        Same as calling getTasks(Filter, int, int) with startIndex of 0, and length of -1 Used as a convenience for calls that do not need to limit the number of tasks being returned
        Parameters:
        filter - Only tasks matching the conditions in this filter are returned in the resulting iterator.
        Returns:
        tasks matching the filter
        Throws:
        TaskManagerException - An error occurred retrieving the tasks
      • getTask

        Task getTask​(java.lang.String taskId)
              throws TaskManagerException
        Retrieves a fully populated task instance for the given task id.
        Parameters:
        taskId - String containing a task id.
        Returns:
        Task instance retrieved for the given task id.
        Throws:
        TaskManagerException - An error occurred retrieving the task instance.
      • getTaskByUUID

        Task getTaskByUUID​(java.lang.String taskUUID)
                    throws TaskManagerException
        Retrieves a fully populated task instance for the given task id.
        Parameters:
        taskUUID - String containing a task UUID
        Returns:
        Task instance retrieved for the given task id.
        Throws:
        TaskManagerException - An error occurred retrieving the task instance.
      • getTask

        Task getTask​(java.lang.String taskId,
                     boolean retrieveSubTasks)
              throws TaskManagerException
        Retrieves the task identified by taskId and opotionally retrieves the task's subtasks.
        Parameters:
        taskId - String containing a task id.
        retrieveSubTasks - true to retrieve this task's subtasks, false otherwise.
        Returns:
        Task instance for the given taskId
        Throws:
        TaskManagerException - an error occurred retrieving the task instance.
      • completeTask

        void completeTask​(java.lang.String taskId,
                          java.lang.String actionId)
                   throws TaskNotFoundException,
                          TaskManagerException
        Completes the task with the given id and action.
        Parameters:
        taskId - String containing the ID of the task to complete.
        actionId - the Id of the action to complete the task with, or null.
        Throws:
        TaskNotFoundException - The task being completed could not be found
        TaskManagerException - An error occurred completing the task instance.
      • getTaskManagerFactory

        TaskManagerFactory getTaskManagerFactory()
        Returns a task manager factory to instantiate various objects of the taskmanager interface like Task and TaskAction.
        Returns:
        instance of TaskManagerFactory
        See Also:
        TaskManagerFactory