public interface TaskService
| Modifier and Type | Method and Description |
|---|---|
Task |
cancelClaim(String taskId)
Unclaim a existing Task which was claimed and owned by you before.
|
Task |
cancelClaim(String taskId,
boolean forceCancel)
Unclaim a existing Task which was claimed and owned by you before.
|
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.
|
BulkOperationResults<String,TaskanaException> |
completeTasks(List<String> taskIds)
Completes a list of tasks.
|
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.
|
void |
deleteTask(String taskId)
Deletes the task with the given Id.
|
void |
deleteTask(String taskId,
boolean forceDelete)
Deletes the task with the given Id.
|
BulkOperationResults<String,TaskanaException> |
deleteTasks(List<String> tasks)
Deletes a list of tasks.
|
Task |
getTask(String taskId)
Get the details of a task by Id without checking permissions.
|
Attachment |
newAttachment()
Returns a not persisted instance of
Attachment. |
Task |
newTask(String workbasketId)
Returns a not persisted instance of
Task. |
Task |
newTask(String workbasketKey,
String domain)
Returns a not persisted instance of
Task. |
Task |
setTaskRead(String taskId,
boolean isRead)
Marks a task as read.
|
Task |
transfer(String taskId,
String destinationWorkbasketId)
Transfer a task to another work basket.
|
Task |
transfer(String taskId,
String workbasketKey,
String domain)
Transfer a task to another work basket.
|
BulkOperationResults<String,TaskanaException> |
transferTasks(String destinationWorkbasketId,
List<String> taskIds)
Transfers a list of tasks to an other workbasket.
|
BulkOperationResults<String,TaskanaException> |
transferTasks(String destinationWorkbasketKey,
String destinationWorkbasketDomain,
List<String> taskIds)
Transfers a list of tasks to an other workbasket.
|
Task |
updateTask(Task task)
Update a task.
|
List<String> |
updateTasks(ObjectReference selectionCriteria,
Map<String,String> customFieldsToUpdate)
Completes tasks with a matching
ObjectReference. |
Task claim(String taskId) throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException
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 READYInvalidOwnerException - if the task with taskId is claimed by some elseNotAuthorizedException - if the current user has no read permission for the workbasket the task is inTask claim(String taskId, boolean forceClaim) throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException
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 READYInvalidOwnerException - if the task with taskId is claimed by someone elseNotAuthorizedException - if the current user has no read permission for the workbasket the task is inTask cancelClaim(String taskId) throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException
taskId - id of the task which should be unclaimed.TaskNotFoundException - if the task can´t be found or does not existInvalidStateException - when the task is already completed.InvalidOwnerException - when the task is claimed by another user.NotAuthorizedException - if the current user has no read permission for the workbasket the task is inTask cancelClaim(String taskId, boolean forceCancel) throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException
taskId - id of the task which should be unclaimed.forceCancel - force the cancellation of claim. If true, the task is unclaimed even if it was claimed by another
user.TaskNotFoundException - if the task can´t be found or does not existInvalidStateException - when the task is already completed.InvalidOwnerException - when forceCancel is false and the task is claimed by another user.NotAuthorizedException - if the current user has no read permission for the workbasket the task is inTask completeTask(String taskId) throws TaskNotFoundException, InvalidOwnerException, InvalidStateException, NotAuthorizedException
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.NotAuthorizedException - if the current user has no read permission for the workbasket the task is inTask completeTask(String taskId, boolean isForced) throws TaskNotFoundException, InvalidOwnerException, InvalidStateException, NotAuthorizedException
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.NotAuthorizedException - if the current user has no read permission for the workbasket the task is inTask createTask(Task taskToCreate) throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, TaskAlreadyExistException, 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 foundInvalidArgumentException - thrown if the primary ObjectReference is invalidTask getTask(String taskId) throws TaskNotFoundException, NotAuthorizedException
taskId - the id of the taskTaskNotFoundException - thrown of the Task with taskId is not foundNotAuthorizedException - if the current user has no READ permission for the workbasket the task is in.Task transfer(String taskId, String destinationWorkbasketId) throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException, InvalidStateException
taskId - The id of the Task to be transferreddestinationWorkbasketId - The Id 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 propertyInvalidStateException - Thrown if the task is in a state which does not allow transferringTask transfer(String taskId, String workbasketKey, String domain) throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException, InvalidStateException
taskId - The id of the Task to be transferredworkbasketKey - The key of the target work basketdomain - The domain 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 propertyInvalidStateException - Thrown if the task is in a state which does not allow transferringTask setTaskRead(String taskId, boolean isRead) throws TaskNotFoundException, NotAuthorizedException
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 foundNotAuthorizedException - if the current user has no read permission for the workbasket the task is inTaskQuery createTaskQuery()
TaskQueryTask newTask(String workbasketId)
Task.workbasketId - the id of the workbasket to which the task belongsTask newTask(String workbasketKey, String domain)
Task.workbasketKey - the key of the workbasket to which the task belongsdomain - the domain 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.BulkOperationResults<String,TaskanaException> transferTasks(String destinationWorkbasketId, List<String> taskIds) throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException
destinationWorkbasketId - target workbasket idtaskIds - source task which will be movedNotAuthorizedException - if the caller hasn´t permissions on tarket WB.InvalidArgumentException - if the method paramesters are EMPTY or NULL.WorkbasketNotFoundException - if the target WB can´t be found.BulkOperationResults<String,TaskanaException> transferTasks(String destinationWorkbasketKey, String destinationWorkbasketDomain, List<String> taskIds) throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException
destinationWorkbasketKey - target workbasket keydestinationWorkbasketDomain - target workbasket domaintaskIds - source task which will be movedNotAuthorizedException - if the caller hasn´t permissions on tarket WB.InvalidArgumentException - if the method paramesters are EMPTY or NULL.WorkbasketNotFoundException - if the target WB can´t be found.void deleteTask(String taskId) throws TaskNotFoundException, InvalidStateException, NotAuthorizedException
taskId - The Id of the task to delete.TaskNotFoundException - If the given Id does not refer to an existing task.InvalidStateException - If the state of the referenced task is not Completed.NotAuthorizedException - if the current user is not member of role ADMINvoid deleteTask(String taskId, boolean forceDelete) throws TaskNotFoundException, InvalidStateException, NotAuthorizedException
taskId - The Id of the task to delete.forceDelete - force the deletion. If true, a task is deleted even if it is not in state completed.TaskNotFoundException - If the given Id does not refer to an existing task.InvalidStateException - If the state of the referenced task is not Completed and forceDelet is false.NotAuthorizedException - if the current user is not member of role ADMINBulkOperationResults<String,TaskanaException> deleteTasks(List<String> tasks) throws InvalidArgumentException
tasks - the ids of the tasks to delete.InvalidArgumentException - if the TaskIds parameter is NULLBulkOperationResults<String,TaskanaException> completeTasks(List<String> taskIds) throws InvalidArgumentException
taskIds - of the tasks which should be completed.InvalidArgumentException - If the taskId parameter is NULL.List<String> updateTasks(ObjectReference selectionCriteria, Map<String,String> customFieldsToUpdate) throws InvalidArgumentException
ObjectReference.selectionCriteria - the ObjectReference that is used to select the tasks.customFieldsToUpdate - a Map that contains as key the identification of the custom field and as value the
corresponding new value of that custom field. The key for identification of the custom field must be a
String with value "1", "2" ... "16" as in the setCustomAttribute or getCustomAttribute method of
TaskInvalidArgumentException - If the customFieldsToUpdate map contains an invalid key or if the selectionCriteria is invalidCopyright © 2018. All rights reserved.