public interface TaskService
| Modifier and Type | Method and Description |
|---|---|
Task |
claim(String taskId)
Claim an existing task for the current user.
|
Task |
claim(String taskId,
boolean forceClaim)
Claim an existing task for the current user.
|
Task |
completeTask(String taskId)
Complete a claimed Task as owner/admin and update State and Timestamps.
|
Task |
completeTask(String taskId,
boolean isForced)
Complete a claimed Task and update State and Timestamps.
|
Task |
createTask(Task taskToCreate)
Persists a not persisted Task which does not exist already.
|
TaskQuery |
createTaskQuery()
This method provides a query builder for quering the database.
|
Task |
getTaskById(String taskId)
Get the details of a task by Id.
|
List<Task> |
getTasksByWorkbasketKeyAndState(String workbasketKey,
TaskState taskState)
Getting a list of all Tasks which got matching workbasketIds and states.
|
List<TaskSummary> |
getTaskSummariesByWorkbasketKey(String workbasketKey)
Getting a short summary of all tasks in a specific work basket.
|
Task |
newTask()
Returns a not persisted instance of
Task. |
Task |
setTaskRead(String taskId,
boolean isRead)
Marks a task as read.
|
Task |
transfer(String taskId,
String workbasketKey)
Transfer a task to another work basket.
|
Task claim(String taskId) throws TaskNotFoundException, InvalidStateException, InvalidOwnerException
taskId - the id of the task to be claimedTaskNotFoundException - if the task with taskId was not foundInvalidStateException - if the state of the task with taskId is not TaskState.READYInvalidOwnerException - if the task with taskId is claimed by some elseTask claim(String taskId, boolean forceClaim) throws TaskNotFoundException, InvalidStateException, InvalidOwnerException
taskId - the id of the task to be claimedforceClaim - if true, claim is performed even if the task is already claimed by someone elseTaskNotFoundException - if the task with taskId was not foundInvalidStateException - if the state of the task with taskId is not TaskState.READYInvalidOwnerException - if the task with taskId is claimed by someone elseTask completeTask(String taskId) throws TaskNotFoundException, InvalidOwnerException, InvalidStateException
taskId - - Id of the Task which should be completed.InvalidStateException - when Task wasn´t claimed before.TaskNotFoundException - if the given Task can´t be found in DB.InvalidOwnerException - if current user is not the task-owner or administrator.Task completeTask(String taskId, boolean isForced) throws TaskNotFoundException, InvalidOwnerException, InvalidStateException
taskId - - Id of the Task which should be completed.isForced - - Flag which can complete a Task in every case if Task does exist.InvalidStateException - when Task wasn´t claimed before.TaskNotFoundException - if the given Task can´t be found in DB.InvalidOwnerException - if current user is not the task-owner or administrator.Task createTask(Task taskToCreate) throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException
taskToCreate - the transient task object to be persistedTaskAlreadyExistException - when the Task does already exist.NotAuthorizedException - thrown if the current user is not authorized to create that taskWorkbasketNotFoundException - thrown if the work basket referenced by the task is not foundClassificationNotFoundException - thrown if the Classification referenced by the task is not foundInvalidWorkbasketException - thrown if the referenced Workbasket has missing required propertiesTask getTaskById(String taskId) throws TaskNotFoundException
taskId - the id of the taskTaskNotFoundException - thrown of the Task with taskId is not foundTask transfer(String taskId, String workbasketKey) throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException
taskId - The id of the Task to be transferredworkbasketKey - The key of the target work basketTaskNotFoundException - Thrown if the Task with taskId was not found.WorkbasketNotFoundException - Thrown if the target work basket was not found.NotAuthorizedException - Thrown if the current user is not authorized to transfer this Task to the target work basketInvalidWorkbasketException - Thrown if either the source or the target workbasket has a missing required propertyTask setTaskRead(String taskId, boolean isRead) throws TaskNotFoundException
taskId - the id of the task to be updatedisRead - the new status of the read flag.TaskNotFoundException - Thrown if the Task with taskId was not foundTaskQuery createTaskQuery()
TaskQueryList<Task> getTasksByWorkbasketKeyAndState(String workbasketKey, TaskState taskState) throws WorkbasketNotFoundException, NotAuthorizedException
workbasketKey - the key of the workbasket where the tasks need to be in.taskState - which is required for the request,WorkbasketNotFoundException - if the workbasketId can´t be resolved to a existing work basket.NotAuthorizedException - if the current user got no rights for reading on this work basket.List<TaskSummary> getTaskSummariesByWorkbasketKey(String workbasketKey) throws WorkbasketNotFoundException, InvalidWorkbasketException
workbasketKey - Key of work basket where tasks are located.WorkbasketNotFoundException - if a Work basket can´t be located.InvalidWorkbasketException - thrown if the Workbasket specified with workbasketId has a missing required propertyCopyright © 2017. All rights reserved.