Package pro.taskana.task.api
Interface TaskService
-
- All Known Implementing Classes:
TaskServiceImpl
public interface TaskServiceThe Task Service manages all operations on tasks.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description TaskcancelClaim(String taskId)Cancel the claim of an existing task if it was claimed by the current user before.TaskcancelTask(String taskId)Cancels a task.Taskclaim(String taskId)Claim an existing task for the current user.TaskcompleteTask(String taskId)Complete a claimed Task as owner/admin and update State and Timestamps.BulkOperationResults<String,TaskanaException>completeTasks(List<String> taskIds)Completes a list of tasks.TaskcreateTask(Task taskToCreate)Inserts a not existing Task.TaskCommentcreateTaskComment(TaskComment taskComment)Create a task comment.TaskQuerycreateTaskQuery()This method provides a query builder for querying the database.voiddeleteTask(String taskId)Deletes the task with the given Id.voiddeleteTaskComment(String taskCommentId)Deletes the task comment with the given Id.BulkOperationResults<String,TaskanaException>deleteTasks(List<String> tasks)Deletes a list of tasks.TaskforceCancelClaim(String taskId)Cancel the claim of an existing task even if it was claimed by another user.TaskforceClaim(String taskId)Claim an existing task for the current user even if it is already claimed by someone else.TaskforceCompleteTask(String taskId)Completes a Task and updates State and Timestamps in every case if the Task exists.BulkOperationResults<String,TaskanaException>forceCompleteTasks(List<String> taskIds)Completes a list of tasks.voidforceDeleteTask(String taskId)Deletes the task with the given Id even if it is not completed.TaskgetTask(String taskId)Gets the details of a task by Id without checking permissions.TaskCommentgetTaskComment(String taskCommentId)Retrieves a task comment for a given taskCommentId.List<TaskComment>getTaskComments(String taskId)Retrieves a list of task comments for a given taskId.AttachmentnewAttachment()Returns a not inserted instance ofAttachment.TasknewTask()Returns a not inserted instance ofTask.TasknewTask(String workbasketId)Returns a not inserted instance ofTask.TasknewTask(String workbasketKey, String domain)Returns a not inserted instance ofTask.TaskCommentnewTaskComment(String taskId)Returns a not inserted instance ofTaskComment.TaskselectAndClaim(TaskQuery taskQuery)Selects and claims the first task which is returned by the task query.BulkOperationResults<String,TaskanaException>setCallbackStateForTasks(List<String> externalIds, CallbackState state)Sets the callback state on a list of tasks.BulkOperationResults<String,TaskanaException>setOwnerOfTasks(String owner, List<String> taskIds)Sets the owner on a list of tasks.BulkOperationResults<String,TaskanaException>setPlannedPropertyOfTasks(Instant planned, List<String> taskIds)Sets the planned property on a list of tasks.TasksetTaskRead(String taskId, boolean isRead)Marks a task as read.TaskterminateTask(String taskId)Terminates a task.default Tasktransfer(String taskId, String destinationWorkbasketId)Tasktransfer(String taskId, String destinationWorkbasketId, boolean setTransferFlag)Transfers a Task to another Workbasket.default Tasktransfer(String taskId, String workbasketKey, String domain)Tasktransfer(String taskId, String workbasketKey, String domain, boolean setTransferFlag)Transfers a Task to another Workbasket.default BulkOperationResults<String,TaskanaException>transferTasks(String destinationWorkbasketKey, String destinationWorkbasketDomain, List<String> taskIds)Transfers a list of Tasks to another Workbasket while always setting the TaskSummary.isTransferred() flag.BulkOperationResults<String,TaskanaException>transferTasks(String destinationWorkbasketKey, String destinationWorkbasketDomain, List<String> taskIds, boolean setTransferFlag)Transfers a list of Tasks to another Workbasket.default BulkOperationResults<String,TaskanaException>transferTasks(String destinationWorkbasketId, List<String> taskIds)BulkOperationResults<String,TaskanaException>transferTasks(String destinationWorkbasketId, List<String> taskIds, boolean setTransferFlag)Transfers a list of Tasks to another Workbasket.TaskupdateTask(Task task)Update a task.TaskCommentupdateTaskComment(TaskComment taskComment)Update a task comment.List<String>updateTasks(List<String> taskIds, Map<TaskCustomField,String> customFieldsToUpdate)Updates tasks with matching taskIds.List<String>updateTasks(ObjectReference selectionCriteria, Map<TaskCustomField,String> customFieldsToUpdate)Updates tasks with a matchingObjectReference.
-
-
-
Method Detail
-
claim
Task claim(String taskId) throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException
Claim an existing task for the current user.- Parameters:
taskId- the id of the task to be claimed- Returns:
- claimed Task
- Throws:
TaskNotFoundException- 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 in
-
forceClaim
Task forceClaim(String taskId) throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException
Claim an existing task for the current user even if it is already claimed by someone else.- Parameters:
taskId- the id of the task to be claimed- Returns:
- claimed Task
- Throws:
TaskNotFoundException- 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 in
-
cancelClaim
Task cancelClaim(String taskId) throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException
Cancel the claim of an existing task if it was claimed by the current user before.- Parameters:
taskId- id of the task which should be unclaimed.- Returns:
- updated unclaimed task
- Throws:
TaskNotFoundException- if the task can't be found or does not existInvalidStateException- if the task is already in an end state.InvalidOwnerException- if the task is claimed by another user.NotAuthorizedException- if the current user has no read permission for the workbasket the task is in
-
forceCancelClaim
Task forceCancelClaim(String taskId) throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException
Cancel the claim of an existing task even if it was claimed by another user.- Parameters:
taskId- id of the task which should be unclaimed.- Returns:
- updated unclaimed task
- Throws:
TaskNotFoundException- if the task can't be found or does not existInvalidStateException- if the task is already in an end state.InvalidOwnerException- if 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 in
-
completeTask
Task completeTask(String taskId) throws TaskNotFoundException, InvalidOwnerException, InvalidStateException, NotAuthorizedException
Complete a claimed Task as owner/admin and update State and Timestamps. If task is already completed, the task is returned as itself.- Parameters:
taskId- - Id of the Task which should be completed.- Returns:
- Task - updated task after completion.
- Throws:
InvalidStateException- if 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 in
-
forceCompleteTask
Task forceCompleteTask(String taskId) throws TaskNotFoundException, InvalidOwnerException, InvalidStateException, NotAuthorizedException
Completes a Task and updates State and Timestamps in every case if the Task exists. If task is already completed, the task is returned as itself.- Parameters:
taskId- - Id of the Task which should be completed.- Returns:
- Task - updated task after completion.
- Throws:
InvalidStateException- if 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 in
-
createTask
Task createTask(Task taskToCreate) throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, TaskAlreadyExistException, InvalidArgumentException, AttachmentPersistenceException
Inserts a not existing Task.
The default values of the created Task are:- id - generated by IdGenerator
- externalId - generated by IdGenerator
- businessProcessId - generated by IdGenerator
- name - name of its Classification
- description - description of its Classification
- creator - id of current user
- state - 'READY'
- isRead -
false - isTransferred -
false
- Parameters:
taskToCreate- the transient task object to be inserted- Returns:
- the created and inserted task
- Throws:
TaskAlreadyExistException- if the Task does already exist.NotAuthorizedException- thrown if the current user is not authorized to create that taskWorkbasketNotFoundException- thrown if the workbasket referenced by the task is not foundClassificationNotFoundException- thrown if the Classification referenced by the task is not foundInvalidArgumentException- thrown if the primary ObjectReference is invalidAttachmentPersistenceException- if an Attachment with ID will be added multiple times without using the task-methods
-
getTask
Task getTask(String taskId) throws TaskNotFoundException, NotAuthorizedException
Gets the details of a task by Id without checking permissions.- Parameters:
taskId- the id of the task- Returns:
- the Task
- Throws:
TaskNotFoundException- thrown of theTaskwith taskId is not foundNotAuthorizedException- if the current user has no READ permission for the workbasket the task is in.
-
transfer
default Task transfer(String taskId, String destinationWorkbasketId) throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException
-
transfer
Task transfer(String taskId, String destinationWorkbasketId, boolean setTransferFlag) throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException
Transfers a Task to another Workbasket.The transfer resets the read flag and sets the transfer flag if
setTransferFlagistrue.- Parameters:
taskId- the id of the Task which should be transferreddestinationWorkbasketId- the id of the target WorkbasketsetTransferFlag- the control about whether to set the TaskSummary.isTransferred() flag or not- Returns:
- the transferred Task
- Throws:
TaskNotFoundException- Thrown if the Task with taskId was not found.WorkbasketNotFoundException- Thrown if the target Workbasket was not found.NotAuthorizedException- Thrown if the current user is not authorized to transfer this Task to the target WorkbasketInvalidStateException- Thrown if the Task is in a state which does not allow transferring
-
transfer
default Task transfer(String taskId, String workbasketKey, String domain) throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException
-
transfer
Task transfer(String taskId, String workbasketKey, String domain, boolean setTransferFlag) throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException
Transfers a Task to another Workbasket.The transfer resets the read flag and sets the transfer flag if
setTransferFlagistrue.- Parameters:
taskId- the id of the Task which should be transferredworkbasketKey- the key of the target Workbasketdomain- the domain of the target WorkbasketsetTransferFlag- the control about whether to set the TaskSummary.isTransferred() flag or not- Returns:
- the transferred Task
- Throws:
TaskNotFoundException- Thrown if theTaskwith taskId was not found.WorkbasketNotFoundException- Thrown if the target Workbasket was not found.NotAuthorizedException- Thrown if the current user is not authorized to transfer this Task to the target WorkbasketInvalidStateException- Thrown if the Task is in a state which does not allow transferring
-
setTaskRead
Task setTaskRead(String taskId, boolean isRead) throws TaskNotFoundException, NotAuthorizedException
Marks a task as read.- Parameters:
taskId- the id of the task to be updatedisRead- the new status of the read flag.- Returns:
- the updated Task
- Throws:
TaskNotFoundException- Thrown if theTaskwith taskId was not foundNotAuthorizedException- if the current user has no read permission for the workbasket the task is in
-
createTaskQuery
TaskQuery createTaskQuery()
This method provides a query builder for querying the database.- Returns:
- a
TaskQuery
-
newTask
Task newTask()
Returns a not inserted instance ofTask. The returned task has no workbasket Id set. When createTask() is invoked for this task, TaskService will call the TaskRouting SPI to determine a workbasket for the task. If the TaskRouting API is not active, e.g. because no TaskRouter is registered, or the TaskRouter(s) don't find a workbasket, the task will not be inserted.- Returns:
- an empty new Task
-
newTask
Task newTask(String workbasketId)
Returns a not inserted instance ofTask.- Parameters:
workbasketId- the id of the workbasket to which the task belongs- Returns:
- an empty new Task
-
newTask
Task newTask(String workbasketKey, String domain)
Returns a not inserted instance ofTask.- Parameters:
workbasketKey- the key of the workbasket to which the task belongsdomain- the domain of the workbasket to which the task belongs- Returns:
- an empty new Task
-
newTaskComment
TaskComment newTaskComment(String taskId)
Returns a not inserted instance ofTaskComment.- Parameters:
taskId- The id of the task to which the task comment belongs- Returns:
- an empty new TaskComment
-
newAttachment
Attachment newAttachment()
Returns a not inserted instance ofAttachment.- Returns:
- an empty new Attachment
-
updateTask
Task updateTask(Task task) throws InvalidArgumentException, TaskNotFoundException, ConcurrencyException, ClassificationNotFoundException, NotAuthorizedException, AttachmentPersistenceException, InvalidStateException
Update a task.- Parameters:
task- the task to be updated in the database- Returns:
- the updated task
- Throws:
InvalidArgumentException- 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 userClassificationNotFoundException- if the updated task refers to a classification 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-methodsInvalidStateException- if an attempt is made to change the owner of the task and the task is not in state READY .
-
transferTasks
default BulkOperationResults<String,TaskanaException> transferTasks(String destinationWorkbasketId, List<String> taskIds) throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException
-
transferTasks
BulkOperationResults<String,TaskanaException> transferTasks(String destinationWorkbasketId, List<String> taskIds, boolean setTransferFlag) throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException
Transfers a list of Tasks to another Workbasket.The transfer resets the read flag and sets the transfer flag if
setTransferFlagistrue. Exceptions will be thrown if the caller got no permissions on the target or it does not exist. Other Exceptions will be stored and returned in the end.- Parameters:
destinationWorkbasketId- target Workbasket idtaskIds- list of source Tasks which will be movedsetTransferFlag- the control about whether to set the TaskSummary.isTransferred() flag or not- Returns:
- Bulkresult with ID and Error in it for failed transactions.
- Throws:
NotAuthorizedException- if the caller has no permissions on target Workbasket.InvalidArgumentException- if the method parameters are EMPTY or NULL.WorkbasketNotFoundException- if the target Workbasket can not be found.
-
transferTasks
default BulkOperationResults<String,TaskanaException> transferTasks(String destinationWorkbasketKey, String destinationWorkbasketDomain, List<String> taskIds) throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException
Transfers a list of Tasks to another Workbasket while always setting the TaskSummary.isTransferred() flag.
-
transferTasks
BulkOperationResults<String,TaskanaException> transferTasks(String destinationWorkbasketKey, String destinationWorkbasketDomain, List<String> taskIds, boolean setTransferFlag) throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException
Transfers a list of Tasks to another Workbasket.The transfer resets the read flag and sets the transfer flag if
setTransferFlagistrue. Exceptions will be thrown if the caller got no permissions on the target or it does not exist. Other Exceptions will be stored and returned in the end.- Parameters:
destinationWorkbasketKey- target Workbasket keydestinationWorkbasketDomain- target Workbasket domaintaskIds- list of source Tasks which will be movedsetTransferFlag- the control about whether to set the TaskSummary.isTransferred() flag or not- Returns:
- BulkResult with ID and Error in it for failed transactions.
- Throws:
NotAuthorizedException- if the caller has no permissions on target Workbasket.InvalidArgumentException- if the method parameters are EMPTY or NULL.WorkbasketNotFoundException- if the target Workbasket can not be found.
-
deleteTask
void deleteTask(String taskId) throws TaskNotFoundException, InvalidStateException, NotAuthorizedException
Deletes the task with the given Id.- Parameters:
taskId- The Id of the task to delete.- Throws:
TaskNotFoundException- If the given Id does not refer to an existing task.InvalidStateException- If the state of the referenced task is not an end state.NotAuthorizedException- if the current user is not member of role ADMIN
-
forceDeleteTask
void forceDeleteTask(String taskId) throws TaskNotFoundException, InvalidStateException, NotAuthorizedException
Deletes the task with the given Id even if it is not completed.- Parameters:
taskId- The Id of the task to delete.- Throws:
TaskNotFoundException- If the given Id does not refer to an existing task.InvalidStateException- If the state of the referenced task is not an end state and forceDelete is false.NotAuthorizedException- if the current user is not member of role ADMIN
-
selectAndClaim
Task selectAndClaim(TaskQuery taskQuery) throws NotAuthorizedException, InvalidOwnerException
Selects and claims the first task which is returned by the task query.- Parameters:
taskQuery- the task query.- Returns:
- the task that got selected and claimed
- Throws:
InvalidOwnerException- if the task is claimed by someone elseNotAuthorizedException- if the current user has no read permission for the workbasket the task is in
-
deleteTasks
BulkOperationResults<String,TaskanaException> deleteTasks(List<String> tasks) throws InvalidArgumentException, NotAuthorizedException
Deletes a list of tasks.- Parameters:
tasks- the ids of the tasks to delete.- Returns:
- the result of the operations with Id and Exception for each failed task deletion.
- Throws:
InvalidArgumentException- if the TaskIds parameter is NULLNotAuthorizedException- if the current user is not member of role ADMIN
-
completeTasks
BulkOperationResults<String,TaskanaException> completeTasks(List<String> taskIds) throws InvalidArgumentException
Completes a list of tasks.- Parameters:
taskIds- of the tasks which should be completed.- Returns:
- the result of the operations with Id and Exception for each failed task completion.
- Throws:
InvalidArgumentException- If the taskId parameter is NULL.
-
forceCompleteTasks
BulkOperationResults<String,TaskanaException> forceCompleteTasks(List<String> taskIds) throws InvalidArgumentException
Completes a list of tasks.- Parameters:
taskIds- of the tasks which should be completed.- Returns:
- the result of the operations with Id and Exception for each failed task completion.
- Throws:
InvalidArgumentException- If the taskId parameter is NULL.- See Also:
forceCompleteTask(java.lang.String)
-
updateTasks
List<String> updateTasks(ObjectReference selectionCriteria, Map<TaskCustomField,String> customFieldsToUpdate) throws InvalidArgumentException
Updates tasks with a matchingObjectReference.- Parameters:
selectionCriteria- theObjectReferencethat is used to select the tasks.customFieldsToUpdate- aMapthat contains as key the identification of the custom field and as value the corresponding new value of that custom field.- Returns:
- a list of the Ids of all modified tasks
- Throws:
InvalidArgumentException- if the given selectionCriteria is invalid or the given customFieldsToUpdate are null or empty.
-
updateTasks
List<String> updateTasks(List<String> taskIds, Map<TaskCustomField,String> customFieldsToUpdate) throws InvalidArgumentException
Updates tasks with matching taskIds.- Parameters:
taskIds- the taskIds that are used to select the tasks.customFieldsToUpdate- aMapthat contains as key the identification of the custom field and as value the corresponding new value of that custom field.- Returns:
- a list of the Ids of all modified tasks
- Throws:
InvalidArgumentException- if the given customFieldsToUpdate are null or empty.
-
createTaskComment
TaskComment createTaskComment(TaskComment taskComment) throws NotAuthorizedException, TaskNotFoundException, InvalidArgumentException
Create a task comment.- Parameters:
taskComment- the task comment to be created.- Returns:
- the created task comment.
- Throws:
NotAuthorizedException- If the current user has no authorization to create a task comment for the given taskId in the TaskComment or is not authorized to access the task.TaskNotFoundException- If the given taskId in the TaskComment does not refer to an existing task.InvalidArgumentException- If the given taskCommentId from the provided task comment is not null or empty
-
updateTaskComment
TaskComment updateTaskComment(TaskComment taskComment) throws NotAuthorizedException, ConcurrencyException, TaskCommentNotFoundException, TaskNotFoundException, InvalidArgumentException
Update a task comment.- Parameters:
taskComment- the task comment to be updated in the database.- Returns:
- the updated task comment.
- Throws:
NotAuthorizedException- If the current user has no authorization to update a task comment or is not authorized to access the task.ConcurrencyException- if an attempt is made to update the task comment and another user. updated it already.TaskCommentNotFoundException- If the given taskCommentId in the TaskComment does not refer to an existing taskComment.TaskNotFoundException- If the given taskId in the TaskComment does not refer to an existing task.InvalidArgumentException- If the given taskCommentId from the provided task comment is null or empty
-
deleteTaskComment
void deleteTaskComment(String taskCommentId) throws NotAuthorizedException, TaskCommentNotFoundException, TaskNotFoundException, InvalidArgumentException
Deletes the task comment with the given Id.- Parameters:
taskCommentId- The id of the task comment to delete.- Throws:
NotAuthorizedException- If the current user has no authorization to delete a task comment or is not authorized to access the task.InvalidArgumentException- If the taskCommentId is null/emptyTaskCommentNotFoundException- If the given taskCommentId in the TaskComment does not refer to an existing taskComment.TaskNotFoundException- If the given taskId in the TaskComment does not refer to an existing task.InvalidArgumentException- If the given taskCommentId is null or empty
-
getTaskComment
TaskComment getTaskComment(String taskCommentId) throws TaskCommentNotFoundException, NotAuthorizedException, TaskNotFoundException, InvalidArgumentException
Retrieves a task comment for a given taskCommentId.- Parameters:
taskCommentId- The id of the task comment which should be retrieved- Returns:
- the task comment identified by taskCommentId
- Throws:
TaskCommentNotFoundException- If the given taskCommentId in the TaskComment does not refer to an existing taskComment.NotAuthorizedException- If the current user has no authorization to retrieve a taskComment from a certain task or is not authorized to access the task.TaskNotFoundException- If the given taskId in the TaskComment does not refer to an existing task.InvalidArgumentException- If the given taskCommentId is null or empty
-
getTaskComments
List<TaskComment> getTaskComments(String taskId) throws NotAuthorizedException, TaskNotFoundException
Retrieves a list of task comments for a given taskId.- Parameters:
taskId- The id of the task for which all task comments should be retrieved- Returns:
- the list of task comments attached to task with id taskId
- Throws:
NotAuthorizedException- If the current user has no authorization to retrieve a taskComment from a certain task or is not authorized to access the task.TaskNotFoundException- If the given taskId in the TaskComment does not refer to an existing task.
-
setCallbackStateForTasks
BulkOperationResults<String,TaskanaException> setCallbackStateForTasks(List<String> externalIds, CallbackState state)
Sets the callback state on a list of tasks. Note: this method is primarily intended to be used by the TaskanaAdapter- Parameters:
externalIds- the EXTERNAL_IDs of the tasks on which the callback state is set.state- the callback state that is to be set on the tasks- Returns:
- the result of the operations with Id and Exception for each failed task deletion.
-
setOwnerOfTasks
BulkOperationResults<String,TaskanaException> setOwnerOfTasks(String owner, List<String> taskIds)
Sets the owner on a list of tasks. The owner will only be set on tasks that are in state READY.- Parameters:
owner- the new owner of the taskstaskIds- the IDs of the tasks on which the owner is to be set.- Returns:
- the result of the operations with Id and Exception for each failed task update.
-
setPlannedPropertyOfTasks
BulkOperationResults<String,TaskanaException> setPlannedPropertyOfTasks(Instant planned, List<String> taskIds)
Sets the planned property on a list of tasks. Only tasks in state READY and CLAIMED will be affected by this method. On each task, the corresponding due date is set according to the shortest service level in the classifications of the task and the task's attachments.- Parameters:
planned- the new 'PLANNED" property of the taskstaskIds- the IDs of the tasks on which the new planned property is to be set.- Returns:
- the result of the operations with Id and Exception for each failed task update.
-
cancelTask
Task cancelTask(String taskId) throws TaskNotFoundException, InvalidStateException, NotAuthorizedException
Cancels a task. Cancellation means a task is obsolete from a business perspective an does not need to be completed anymore.- Parameters:
taskId- the id of the task to cancel.- Returns:
- the updated task.
- Throws:
TaskNotFoundException- if the Task with Id TaskId is not foundInvalidStateException- if the task is not in state READY or CLAIMEDNotAuthorizedException- if the current user is not authorized to see the task
-
terminateTask
Task terminateTask(String taskId) throws TaskNotFoundException, InvalidStateException, NotAuthorizedException
Terminates a task. Termination is a administrative action to complete a task. This is typically done by an administration to correct any technical issue.- Parameters:
taskId- the id of the task to cancel.- Returns:
- the updated task.
- Throws:
TaskNotFoundException- if the Task with Id TaskId is not foundInvalidStateException- if the task is not in state READY or CLAIMEDNotAuthorizedException- if the current user is not authorized to see the task
-
-