Interface TaskManager


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

    • 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.
    • createTask

      Task createTask(String parentTaskId, Task task) throws TaskNotFoundException, TaskManagerException
      Creates a subtask under the specified parentTaskid
      Parameters:
      parentTaskId - the id of the parent task
      task - the task to create
      Returns:
      the newly created task instance
      Throws:
      TaskNotFoundException - if the parent task specified is not found
      TaskManagerException - an error occurred creating the task.
    • getTasks

      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

      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(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(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(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.
    • saveTask

      Saves the given task instance. Note that subtasks will not be updated by this call. Note: you cannot complete a task with this method; to complete a task call completeTask(String, String)
      Parameters:
      task - Task instance to save.
      Returns:
      Saved copy of the given Task instance.
      Throws:
      TaskNotFoundException - The task being saved could not be found
      TaskManagerException - An error occurred saving the task instance.
    • deleteTask

      void deleteTask(String taskId) throws TaskNotFoundException, TaskManagerException
      Deletes the task with the given task ID.
      Parameters:
      taskId - String containing the ID of the task to delete.
      Throws:
      TaskNotFoundException - The task being saved could not be found
      TaskManagerException - An error occurred deleting the task instance.
    • completeTask

      void completeTask(String taskId, 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.
    • terminateTask

      void terminateTask(String taskId) throws TaskNotFoundException, TaskManagerException
      Terminates the task
      Parameters:
      taskId - String containing the ID of the task to complete.
      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: