Interface TaskService
-
- All Known Implementing Classes:
TaskServiceImpl
public interface TaskServiceThe TaskService 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)Taskclaim(String taskId)Claim an existing Task for the current user.TaskcompleteTask(String taskId)BulkOperationResults<String,TaskanaException>completeTasks(List<String> taskIds)Completes a List of Tasks.TaskcreateTask(Task taskToCreate)Inserts a Task that doesn't exist in the database yet.TaskCommentcreateTaskComment(TaskComment taskComment)Inserts the specified TaskComment into the database.TaskCommentQuerycreateTaskCommentQuery()Creates an empty TaskCommentQuery.TaskQuerycreateTaskQuery()Creates an empty TaskQuery.voiddeleteTask(String taskId)voiddeleteTaskComment(String taskCommentId)Deletes the TaskComment 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)BulkOperationResults<String,TaskanaException>forceCompleteTasks(List<String> taskIds)voidforceDeleteTask(String taskId)TaskforceRequestChanges(String taskId)Request changes for an existing Task even if the current user is not the owner or the Task is not in TaskState.IN_REVIEW yet.TaskforceRequestReview(String taskId)Request review for an existing Task even if the current user is not the owner or the Task is not in TaskState.CLAIMED yet.TaskgetTask(String taskId)TaskCommentgetTaskComment(String taskCommentId)Retrieves the TaskComment with the given id.List<TaskComment>getTaskComments(String taskId)AttachmentnewAttachment()Instantiates a non-persistent/non-inserted Attachment.ObjectReferencenewObjectReference()Instantiates a non-persistent/non-inserted ObjectReference.ObjectReferencenewObjectReference(String company, String system, String systemInstance, String type, String value)Instantiates a non-persistent/non-inserted ObjectReference.TasknewTask()Instantiates a non-persistent/non-inserted Task.TasknewTask(String workbasketId)Instantiates a non-persistent/non-inserted Task.TasknewTask(String workbasketKey, String domain)Instantiates a non-persistent/non-inserted Task.TaskCommentnewTaskComment(String taskId)Instantiates a non-persistent/non-inserted TaskComment.TaskrequestChanges(String taskId)Request changes for an existing Task that is in TaskState.IN_REVIEW.TaskrequestReview(String taskId)Request review for an existing Task that is in TaskState.CLAIMED.TaskselectAndClaim(TaskQuery taskQuery)BulkOperationResults<String,TaskanaException>setCallbackStateForTasks(List<String> externalIds, CallbackState state)Sets the specified CallbackState on a List of Tasks.BulkOperationResults<String,TaskanaException>setOwnerOfTasks(String owner, List<String> taskIds)BulkOperationResults<String,TaskanaException>setPlannedPropertyOfTasks(Instant planned, List<String> taskIds)TasksetTaskRead(String taskId, boolean isRead)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)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)Updates the specified TaskComment.List<String>updateTasks(List<String> taskIds, Map<TaskCustomField,String> customFieldsToUpdate)Updates specified TaskCustomFields for all given Tasks.List<String>updateTasks(ObjectReference selectionCriteria, Map<TaskCustomField,String> customFieldsToUpdate)
-
-
-
Method Detail
-
newTask
Task newTask()
Instantiates a non-persistent/non-inserted Task.Since a Task doesn't allow setting a workbasketSummary, please either provide an implementation of the TaskRoutingProvider or use the referenced methods to create a Task within a specific Workbasket.
- Returns:
- the instantiated Task
- See Also:
newTask(String),newTask(String, String)
-
newTask
Task newTask(String workbasketId)
Instantiates a non-persistent/non-inserted Task.- Parameters:
workbasketId- the id of the Workbasket to which the Task belongs- Returns:
- the instantiated Task
- See Also:
newTask(),newTask(String, String)
-
newTask
Task newTask(String workbasketKey, String domain)
Instantiates a non-persistent/non-inserted Task.- Parameters:
workbasketKey- the key of the Workbasket to which the Task belongsdomain- the domain of the Workbasket to which the Task belongs- Returns:
- the instantiated Task
- See Also:
newTask(),newTask(String)
-
createTask
Task createTask(Task taskToCreate) throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, TaskAlreadyExistException, InvalidArgumentException, AttachmentPersistenceException, ObjectReferencePersistenceException
Inserts a Task that doesn't exist in the database yet.If the workbasketSummary of the given Task is NULL, TaskService will call the TaskRoutingProvider to determine a Workbasket for the Task. If the TaskRoutingProvider is not active, e.g. because no TaskRoutingProvider is registered, or the TaskRoutingProvider doesn't find a Workbasket, the Task will not be inserted.
The default values of the created Task are:
- id - generated automatically
- externalId - if NULL, then generated automatically, else unchanged
- businessProcessId - generated automatically
- name - if NULL then the name of its Classification, else unchanged
- description - if NULL then description of its Classification, else unchanged
- creator - id of current user
- state - TaskState.READY
- isRead - false
- isTransferred - false
- Parameters:
taskToCreate- the transient Task to be inserted- Returns:
- the created and inserted Task
- Throws:
TaskAlreadyExistException- if the Task already existsNotAuthorizedException- if the current user has no WorkbasketPermission.APPEND for the Workbasket the Task is inWorkbasketNotFoundException- if the Workbasket referenced by the workbasketSummary of the Task isn't foundClassificationNotFoundException- if the Classification referenced by classificationSummary of the Task isn't foundInvalidArgumentException- if the primaryObjRef is invalidAttachmentPersistenceException- if an Attachment with the same id was added to the Task multiple times without using Task.addAttachment(Attachment)ObjectReferencePersistenceException- if an ObjectReference with the same id was added to the Task multiple times without using TaskSummary.addSecondaryObjectReference(ObjectReference)
-
getTask
Task getTask(String taskId) throws TaskNotFoundException, NotAuthorizedException
- Parameters:
taskId- the id of the Task- Returns:
- the Task with the specified taskId
- Throws:
TaskNotFoundException- if the Task with taskId wasn't foundNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket the Task is in
-
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:
- the claimed Task
- Throws:
TaskNotFoundException- if the Task with taskId was not foundInvalidStateException- if the state of the Task with taskId isn't TaskState.READYInvalidOwnerException- if the Task with taskId is claimed by some elseNotAuthorizedException- if the current user has no WorkbasketPermission.READ 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:
- the claimed Task
- Throws:
TaskNotFoundException- if the Task with taskId was not foundInvalidStateException- if the state of Task with taskId is in TaskState.END_STATESInvalidOwnerException- cannot be thrownNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket the Task is in
-
selectAndClaim
Task selectAndClaim(TaskQuery taskQuery) throws NotAuthorizedException, InvalidOwnerException
- Parameters:
taskQuery- the TaskQuery- Returns:
- the Task that got selected and claimed
- Throws:
InvalidOwnerException- if the Task is claimed by someone elseNotAuthorizedException- if the current user has no WorkbasketPermission.READ 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- the id of the Task which should be unclaimed- Returns:
- the unclaimed Task
- Throws:
TaskNotFoundException- if the Task with taskId was not foundInvalidStateException- if the Task is already in one of the TaskState.END_STATESInvalidOwnerException- if the Task is claimed by another userNotAuthorizedException- if the current user has no WorkbasketPermission.READ 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- the id of the Task which should be unclaimed- Returns:
- the unclaimed Task
- Throws:
TaskNotFoundException- if the Task with taskId was not foundInvalidStateException- if the Task is already in one of the TaskState.END_STATESInvalidOwnerException- cannot be thrownNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket the Task is in
-
requestReview
Task requestReview(String taskId) throws InvalidTaskStateException, TaskNotFoundException, NotAuthorizedException, InvalidOwnerException
Request review for an existing Task that is in TaskState.CLAIMED.- Parameters:
taskId- the id of the specified Task- Returns:
- the Task after a review has been requested
- Throws:
InvalidTaskStateException- if the state of the Task with taskId is not in TaskState.CLAIMEDTaskNotFoundException- if the Task with taskId wasn't foundInvalidOwnerException- if the Task is claimed by another userNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket the Task is in
-
forceRequestReview
Task forceRequestReview(String taskId) throws InvalidTaskStateException, TaskNotFoundException, NotAuthorizedException, InvalidOwnerException
Request review for an existing Task even if the current user is not the owner or the Task is not in TaskState.CLAIMED yet.- Parameters:
taskId- the id of the specified Task- Returns:
- the Task after a review has been requested
- Throws:
InvalidTaskStateException- if the state of the Task with taskId is one of the TaskState.END_STATESTaskNotFoundException- if the Task with taskId wasn't foundInvalidOwnerException- cannot be thrownNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket the Task is in
-
requestChanges
Task requestChanges(String taskId) throws InvalidTaskStateException, TaskNotFoundException, NotAuthorizedException, InvalidOwnerException
Request changes for an existing Task that is in TaskState.IN_REVIEW. The TaskState is changed to TaskState.READY after changes have been requested.- Parameters:
taskId- the id of the specified Task- Returns:
- the Task after changes have been requested
- Throws:
InvalidTaskStateException- if the state of the Task with taskId is not in TaskState.IN_REVIEWTaskNotFoundException- if the Task with taskId wasn't foundInvalidOwnerException- if the Task is claimed by another userNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket the Task is in
-
forceRequestChanges
Task forceRequestChanges(String taskId) throws InvalidTaskStateException, TaskNotFoundException, NotAuthorizedException, InvalidOwnerException
Request changes for an existing Task even if the current user is not the owner or the Task is not in TaskState.IN_REVIEW yet. The TaskState is changed to TaskState.READY after changes have been requested.- Parameters:
taskId- the id of the specified Task- Returns:
- the Task after changes have been requested
- Throws:
InvalidTaskStateException- if the state of the Task with taskId is one of the TaskState.END_STATESTaskNotFoundException- if the Task with taskId wasn't foundInvalidOwnerException- cannot be thrownNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket the Task is in
-
completeTask
Task completeTask(String taskId) throws TaskNotFoundException, InvalidOwnerException, InvalidStateException, NotAuthorizedException
Complete a claimed Task as owner or TaskanaRole.ADMIN and update state and timestamps.If the Task is already completed, the Task is returned unchanged.
- Parameters:
taskId- the id of the Task which should be completed- Returns:
- the completed Task
- Throws:
InvalidStateException- if the state of the Task with taskId is neither TaskState.CLAIMED nor TaskState.COMPLETEDTaskNotFoundException- if the Task with taskId wasn't foundInvalidOwnerException- if current user isn't the owner of the Task or TaskanaRole.ADMINNotAuthorizedException- if the current user has no WorkbasketPermission.READ 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 the Task is already completed, the Task is returned unchanged.
- Parameters:
taskId- the id of the Task which should be completed- Returns:
- the updated Task after completion
- Throws:
InvalidStateException- if the state of the Task with taskId is with taskId is TaskState.TERMINATED or TaskState.CANCELLEDTaskNotFoundException- if the Task with taskId wasn't foundInvalidOwnerException- if current user isn't the owner of the Task or TaskanaRole.ADMINNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket the Task is in
-
completeTasks
BulkOperationResults<String,TaskanaException> completeTasks(List<String> taskIds) throws InvalidArgumentException
Completes a List of Tasks.- Parameters:
taskIds- ids of the Tasks which should be completed- Returns:
- the result of the operations with each id and Exception for each failed completion
- Throws:
InvalidArgumentException- If the taskIds parameter is NULL
-
forceCompleteTasks
BulkOperationResults<String,TaskanaException> forceCompleteTasks(List<String> taskIds) throws InvalidArgumentException
Completes each existing Task in the given List in every case, independent of the owner or state of the Task.- Parameters:
taskIds- id of the Tasks which should be completed- Returns:
- the result of the operations with ids and Exception for each failed completion
- Throws:
InvalidArgumentException- If the taskIds parameter is NULL
-
cancelTask
Task cancelTask(String taskId) throws TaskNotFoundException, InvalidStateException, NotAuthorizedException
Cancels the Task with the given id.Cancellation means a Task is obsolete from a business perspective and doesn't need to be completed anymore.
- Parameters:
taskId- the id of the Task to cancel- Returns:
- the updated Task
- Throws:
TaskNotFoundException- if the Task with taskId wasn't foundInvalidStateException- if the Task isn't in TaskState.READY or TaskState.CLAIMEDNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket the Task is in
-
terminateTask
Task terminateTask(String taskId) throws TaskNotFoundException, InvalidStateException, NotAuthorizedException
Terminates a Task. Termination is an administrative action to complete a Task.This is typically done by administration to correct any technical issue.
- Parameters:
taskId- the id of the Task to terminate- Returns:
- the updated Task
- Throws:
TaskNotFoundException- if the Task with taskId wasn't foundInvalidStateException- if the Task isn't in TaskState.READY or TaskState.CLAIMEDNotAuthorizedException- if the current user isn't member of TaskanaRole.ADMIN or TaskanaRole.TASK_ADMIN
-
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 isRead and sets isTransferred if setTransferFlag is true.
- Parameters:
taskId- the id of the Task which should be transferreddestinationWorkbasketId- the id of the target WorkbasketsetTransferFlag- controls whether to set isTransferred to true or not- Returns:
- the transferred Task
- Throws:
TaskNotFoundException- if the Task with taskId wasn't foundWorkbasketNotFoundException- if the target Workbasket was not foundNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the source Workbasket or no WorkbasketPermission.TRANSFER for the target WorkbasketInvalidStateException- if the Task is in one of the TaskState.END_STATES
-
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 isRead and sets isTransferred if setTransferFlag is true.
- Parameters:
taskId- the id of the Task which should be transferredworkbasketKey- the key of the target Workbasketdomain- the domain of the target WorkbasketsetTransferFlag- controls whether to set isTransferred or not- Returns:
- the transferred Task
- Throws:
TaskNotFoundException- if the Task with taskId was not foundWorkbasketNotFoundException- if the target Workbasket was not foundNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the source Workbasket or no WorkbasketPermission.TRANSFER for the target WorkbasketInvalidStateException- if the Task is in one of the TaskState.END_STATES
-
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 isRead and sets isTransferred if setTransferFlag is true. Exceptions will be thrown if the caller got no WorkbasketPermission on the target or if the target Workbasket doesn't exist. Other Exceptions will be stored and returned in the end.
- Parameters:
destinationWorkbasketId- id of the target WorkbaskettaskIds- List of source Tasks which will be movedsetTransferFlag- controls whether to set isTransferred or not- Returns:
- Bulkresult with ids and Error for each failed transactions
- Throws:
NotAuthorizedException- if the current user has no WorkbasketPermission.READ for the source Workbasket or no WorkbasketPermission.TRANSFER for the target WorkbasketInvalidArgumentException- if the method parameters are empty or NULLWorkbasketNotFoundException- if the target Workbasket can't be found
-
transferTasks
default BulkOperationResults<String,TaskanaException> transferTasks(String destinationWorkbasketKey, String destinationWorkbasketDomain, List<String> taskIds) throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException
-
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 isRead and sets isTransferred if setTransferFlag is true. Exceptions will be thrown if the caller got no WorkbasketPermission on the target Workbasket or if it doesn't exist. Other Exceptions will be stored and returned in the end.
- Parameters:
destinationWorkbasketKey- target keydestinationWorkbasketDomain- target domaintaskIds- List of ids of source Tasks which will be movedsetTransferFlag- controls whether to set isTransferred or not- Returns:
- BulkResult with ids and Error for each failed transactions
- Throws:
NotAuthorizedException- if the current user has no WorkbasketPermission.READ for the source Workbasket or no WorkbasketPermission.TRANSFER for the target WorkbasketInvalidArgumentException- if the method parameters are empty or NULLWorkbasketNotFoundException- if the target Workbasket can't be found
-
updateTask
Task updateTask(Task task) throws InvalidArgumentException, TaskNotFoundException, ConcurrencyException, ClassificationNotFoundException, NotAuthorizedException, AttachmentPersistenceException, ObjectReferencePersistenceException, InvalidStateException
Update a Task.- Parameters:
task- the Task to be updated- Returns:
- the updated Task
- Throws:
InvalidArgumentException- if the Task to be updated contains invalid properties like e.g. invalid secondaryObjectReferencesTaskNotFoundException- if the Task isn't found in the database by its idConcurrencyException- if the Task has been updated by another user in the meantime; that's the case if the given modified timestamp differs from the one in the databaseClassificationNotFoundException- if the classificationSummary of the updated Task refers to aClassificationthat can't be foundNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket the Task is inAttachmentPersistenceException- if an Attachment with the same id was added to the Task multiple times without using Task.addAttachment(Attachment)ObjectReferencePersistenceException- if an ObjectReference with the same id was added to the Task multiple times without using TaskSummary.addSecondaryObjectReference(ObjectReference)InvalidStateException- if an attempt is made to change the owner of the Task that state isn't TaskState.READY
-
updateTasks
List<String> updateTasks(ObjectReference selectionCriteria, Map<TaskCustomField,String> customFieldsToUpdate) throws InvalidArgumentException
- Parameters:
selectionCriteria- the primaryObjRef of the searched-for Tasks.customFieldsToUpdate- a Map that contains as key the identification of the TaskCustomField and as value the corresponding new value of that TaskCustomField- 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- See Also:
updateTasks(List, Map)
-
updateTasks
List<String> updateTasks(List<String> taskIds, Map<TaskCustomField,String> customFieldsToUpdate) throws InvalidArgumentException
Updates specified TaskCustomFields for all given Tasks.- Parameters:
taskIds- the taskIds that are used to select the TaskscustomFieldsToUpdate- a Map that contains as key the identification of the TaskCustomField and as value the corresponding new value of that TaskCustomField- Returns:
- a list of the ids of all modified Tasks
- Throws:
InvalidArgumentException- if the given customFieldsToUpdate are NULL or empty- See Also:
updateTasks(ObjectReference, Map)
-
setTaskRead
Task setTaskRead(String taskId, boolean isRead) throws TaskNotFoundException, NotAuthorizedException
- Parameters:
taskId- the id of the Task to be updatedisRead- the new status of isRead- Returns:
- the updated Task
- Throws:
TaskNotFoundException- if the Task with taskId wasn't foundNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket the Task is in
-
setCallbackStateForTasks
BulkOperationResults<String,TaskanaException> setCallbackStateForTasks(List<String> externalIds, CallbackState state)
Sets the specified CallbackState on a List of Tasks.Note: this method is primarily intended to be used by the TaskanaAdapter
- Parameters:
externalIds- the externalIds of the Tasks on which the CallbackState is setstate- the CallbackState that is to be set on the Tasks- Returns:
- the result of the operations with ids and Exception for each failed operation
-
setOwnerOfTasks
BulkOperationResults<String,TaskanaException> setOwnerOfTasks(String owner, List<String> taskIds)
-
setPlannedPropertyOfTasks
BulkOperationResults<String,TaskanaException> setPlannedPropertyOfTasks(Instant planned, List<String> taskIds)
Sets the planned Instant on a List of Tasks.Only Tasks in state TaskState.READY and TaskState.CLAIMED will be affected by this method. On each Task, the corresponding due Instant is set according to the shortest serviceLevel in the Classification of the Task and its Attachments.
-
deleteTask
void deleteTask(String taskId) throws TaskNotFoundException, InvalidStateException, NotAuthorizedException
- Parameters:
taskId- The id of the Task to delete- Throws:
TaskNotFoundException- If the given id doesn't refer to an existing TaskInvalidStateException- If the state of the referenced Task isn't one of the TaskState.END_STATESNotAuthorizedException- if the current user isn't member of TaskanaRole.ADMIN
-
forceDeleteTask
void forceDeleteTask(String taskId) throws TaskNotFoundException, InvalidStateException, NotAuthorizedException
- Parameters:
taskId- The id of the Task to delete- Throws:
TaskNotFoundException- if the given id doesn't refer to an existing TaskInvalidStateException- if the state of the referenced Task isn't TaskState.TERMINATED or TaskState.CANCELLED and the Callback State of the Task is CallbackState.CALLBACK_PROCESSING_REQUIREDNotAuthorizedException- if the current user isn't member of TaskanaRole.ADMIN
-
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 each id and Exception for each failed deletion
- Throws:
InvalidArgumentException- if the tasks parameter contains NULL valuesNotAuthorizedException- if the current user isn't member of TaskanaRole.ADMIN
-
newTaskComment
TaskComment newTaskComment(String taskId)
Instantiates a non-persistent/non-inserted TaskComment.- Parameters:
taskId- the id of the Task to which the TaskComment belongs- Returns:
- the instantiated TaskComment
-
createTaskComment
TaskComment createTaskComment(TaskComment taskComment) throws NotAuthorizedException, TaskNotFoundException, InvalidArgumentException
Inserts the specified TaskComment into the database.- Parameters:
taskComment- the TaskComment to be created- Returns:
- the created TaskComment
- Throws:
NotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket of the commented Task.TaskNotFoundException- if the given taskId doesn't refer to an existing TaskInvalidArgumentException- if the id of the providedTaskCommentis neither NULL nor empty
-
getTaskComment
TaskComment getTaskComment(String taskCommentId) throws TaskCommentNotFoundException, NotAuthorizedException, TaskNotFoundException, InvalidArgumentException
Retrieves the TaskComment with the given id.- Parameters:
taskCommentId- the id of the TaskComment which should be retrieved- Returns:
- the TaskComment identified by taskCommentId
- Throws:
TaskCommentNotFoundException- if the given taskCommentId doesn't refer to an existing TaskCommentNotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket of the commented TaskTaskNotFoundException- if the taskId of the TaskComment doesn't refer to an existing TaskInvalidArgumentException- if the given taskCommentId is NULL or empty
-
getTaskComments
List<TaskComment> getTaskComments(String taskId) throws NotAuthorizedException, TaskNotFoundException
- Parameters:
taskId- the id of the Task for which all TaskComments should be retrieved- Returns:
- the List of TaskComments attached to the specified Task
- Throws:
NotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket of the commented TaskTaskNotFoundException- if the given taskId doesn't refer to an existing Task
-
updateTaskComment
TaskComment updateTaskComment(TaskComment taskComment) throws NotAuthorizedException, ConcurrencyException, TaskCommentNotFoundException, TaskNotFoundException, InvalidArgumentException
Updates the specified TaskComment.- Parameters:
taskComment- the TaskComment to be updated in the database- Returns:
- the updated TaskComment
- Throws:
NotAuthorizedException- if the current user has no WorkbasketPermission.READ for the Workbasket of the commented Task.ConcurrencyException- if an attempt is made to update the TaskComment and another user updated it already; that's the case if the given modified timestamp differs from the one in the databaseTaskCommentNotFoundException- if the id of the specified TaskComment doesn't refer to an existing TaskCommentTaskNotFoundException- if the taskId doesn't refer to an existing TaskInvalidArgumentException- if the id of the specified TaskComment is NULL or empty
-
deleteTaskComment
void deleteTaskComment(String taskCommentId) throws NotAuthorizedException, TaskCommentNotFoundException, TaskNotFoundException, InvalidArgumentException
Deletes the TaskComment with the given id.- Parameters:
taskCommentId- the id of the TaskComment to delete- Throws:
NotAuthorizedException- if the current user isn't TaskanaRole.ADMIN, TaskanaRole.TASK_ADMIN or the creator of the TaskComment; the user also needs WorkbasketPermission.READ for the Workbasket of the commented TaskInvalidArgumentException- if the taskCommentId is NULL or emptyTaskCommentNotFoundException- if the given taskCommentId doesn't refer to an existing TaskCommentTaskNotFoundException- if the taskId of the TaskComment doesn't refer to an existing TaskInvalidArgumentException- if the given taskCommentId is NULL or empty
-
newAttachment
Attachment newAttachment()
Instantiates a non-persistent/non-inserted Attachment.- Returns:
- the instantiated Attachment
-
newObjectReference
ObjectReference newObjectReference()
Instantiates a non-persistent/non-inserted ObjectReference.- Returns:
- the instantiated ObjectReference
- See Also:
newObjectReference(String, String, String, String, String)
-
newObjectReference
ObjectReference newObjectReference(String company, String system, String systemInstance, String type, String value)
Instantiates a non-persistent/non-inserted ObjectReference.- Parameters:
company- the company of the new ObjectReferencesystem- the system of the new ObjectReferencesystemInstance- the systemInstance of the new ObjectReferencetype- the type of the new ObjectReferencevalue- the value of the new ObjectReference- Returns:
- the instantiated ObjectReference
- See Also:
newObjectReference()
-
createTaskCommentQuery
TaskCommentQuery createTaskCommentQuery()
Creates an empty TaskCommentQuery.- Returns:
- a TaskCommentQuery
-
-