Package com.adobe.granite.taskmanagement
Interface TaskManager
TaskManager defines the task management API.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcompleteTask(String taskId, String actionId) Completes the task with the given id and action.createTask(Task task) Creates a task.createTask(String parentTaskId, Task task) Creates a subtask under the specified parentTaskidvoiddeleteTask(String taskId) Deletes the task with the given task ID.Retrieves a fully populated task instance for the given task id.Retrieves the task identified by taskId and opotionally retrieves the task's subtasks.getTaskByUUID(String taskUUID) Retrieves a fully populated task instance for the given task id.Returns a task manager factory to instantiate various objects of the taskmanager interface like Task and TaskAction.Same as callinggetTasks(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 returnedreturns all tasks for the specified task type, or all tasks if no tasktype specified.Saves the given task instance.voidterminateTask(String taskId) Terminates the task
-
Method Details
-
createTask
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
Creates a subtask under the specified parentTaskid- Parameters:
parentTaskId- the id of the parent tasktask- the task to create- Returns:
- the newly created task instance
- Throws:
TaskNotFoundException- if the parent task specified is not foundTaskManagerException- an error occurred creating the task.
-
getTasks
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 > 0length- 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
Same as callinggetTasks(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
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
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
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 callcompleteTask(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 foundTaskManagerException- An error occurred saving the task instance.
-
deleteTask
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 foundTaskManagerException- 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 foundTaskManagerException- An error occurred completing the task instance.
-
terminateTask
Terminates the task- Parameters:
taskId- String containing the ID of the task to complete.- Throws:
TaskNotFoundException- The task being completed could not be foundTaskManagerException- 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:
-