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 |
getTask(String taskId)
Get the details of a task by Id without checking permissions.
|
List<TaskSummary> |
getTasksByWorkbasketKeyAndState(String workbasketKey,
TaskState taskState)
Getting a list of all Task summaries which got matching workbasketIds and states.
|
List<TaskSummary> |
getTaskSummariesByWorkbasketKey(String workbasketKey)
Getting a short summary of all tasks in a specific work basket.
|
Attachment |
newAttachment()
Returns a not persisted instance of
Attachment. |
Task |
newTask(String workbasketKey)
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 |
updateTask(Task task)
Update a task.
|
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, InvalidArgumentException
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 propertiesInvalidArgumentException - thrown if the primary ObjectReference is invalidTask getTask(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<TaskSummary> getTasksByWorkbasketKeyAndState(String workbasketKey, TaskState taskState) throws WorkbasketNotFoundException, NotAuthorizedException, ClassificationNotFoundException
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.ClassificationNotFoundException - if a single Classification can not be found for a task which is returnedList<TaskSummary> getTaskSummariesByWorkbasketKey(String workbasketKey) throws WorkbasketNotFoundException, NotAuthorizedException
workbasketKey - Key of work basket where tasks are located.WorkbasketNotFoundException - if a Work basket can´t be located.NotAuthorizedException - if the current user got no rights for reading on this work basket.Task newTask(String workbasketKey)
Task.workbasketKey - the key of the workbasket to which the task belongsAttachment newAttachment()
Attachment.Task updateTask(Task task) throws InvalidArgumentException, TaskNotFoundException, ConcurrencyException, WorkbasketNotFoundException, ClassificationNotFoundException, InvalidWorkbasketException, NotAuthorizedException, AttachmentPersistenceException
task - the task to be updated in the databaseInvalidArgumentException - if the task to be updated contains invalid properties like e.g. invalid object referencesTaskNotFoundException - if the id of the task is not found in the databaseConcurrencyException - if the task has already been updated by another userInvalidWorkbasketException - if the updated task refers to a workbasket that has missing required propertiesClassificationNotFoundException - if the updated task refers to a classification that cannot be foundWorkbasketNotFoundException - if the updated task refers to a work basket that cannot be foundNotAuthorizedException - if the current user is not authorized to update the taskAttachmentPersistenceException - if an Attachment with ID will be added multiple times without using the task-methods.Copyright © 2018. All rights reserved.