Package pro.taskana.task.rest
Class TaskController
java.lang.Object
pro.taskana.task.rest.TaskController
Controller for all
Task related endpoints.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic class -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<TaskRepresentationModel>cancelClaimTask(String taskId, boolean keepOwner) This endpoint cancels the claim of an existing Task if it was claimed by the current user before.org.springframework.http.ResponseEntity<TaskRepresentationModel>cancelTask(String taskId) This endpoint cancels a Task.org.springframework.http.ResponseEntity<TaskRepresentationModel>This endpoint claims a Task if possible.org.springframework.http.ResponseEntity<TaskRepresentationModel>completeTask(String taskId) This endpoint completes a Task.org.springframework.http.ResponseEntity<TaskRepresentationModel>createTask(TaskRepresentationModel taskRepresentationModel) This endpoint creates a persistent Task.org.springframework.http.ResponseEntity<TaskRepresentationModel>deleteTask(String taskId) This endpoint deletes a Task.org.springframework.http.ResponseEntity<TaskSummaryCollectionRepresentationModel>deleteTasks(TaskQueryFilterParameter filterParameter, TaskQueryFilterCustomFields filterCustomFields, TaskQueryFilterCustomIntFields filterCustomIntFields) This endpoint deletes an aggregation of Tasks and returns the deleted Tasks.org.springframework.http.ResponseEntity<TaskRepresentationModel>forceCancelClaimTask(String taskId, boolean keepOwner) This endpoint force cancels the claim of an existing Task.org.springframework.http.ResponseEntity<TaskRepresentationModel>forceClaimTask(String taskId, String userName) This endpoint force claims a Task if possible even if it is already claimed by someone else.org.springframework.http.ResponseEntity<TaskRepresentationModel>forceCompleteTask(String taskId) This endpoint force completes a Task.org.springframework.http.ResponseEntity<TaskRepresentationModel>forceDeleteTask(String taskId) This endpoint force deletes a Task even if it's not completed.org.springframework.http.ResponseEntity<TaskRepresentationModel>forceRequestChanges(String taskId) This endpoint force requests changes on a Task.org.springframework.http.ResponseEntity<TaskRepresentationModel>forceRequestReview(String taskId) This endpoint force request a review on the specified Task.org.springframework.http.ResponseEntity<TaskRepresentationModel>This endpoint retrieves a specific Task.org.springframework.http.ResponseEntity<TaskSummaryPagedRepresentationModel>getTasks(jakarta.servlet.http.HttpServletRequest request, TaskQueryFilterParameter filterParameter, TaskQueryFilterCustomFields filterCustomFields, TaskQueryFilterCustomIntFields filterCustomIntFields, TaskQueryGroupByParameter groupByParameter, TaskController.TaskQuerySortParameter sortParameter, QueryPagingParameter<pro.taskana.task.api.models.TaskSummary, pro.taskana.task.api.TaskQuery> pagingParameter) This endpoint retrieves a list of existing Tasks.org.springframework.http.ResponseEntity<TaskRepresentationModel>requestChanges(String taskId) This endpoint request changes on the specified Task.org.springframework.http.ResponseEntity<TaskRepresentationModel>requestReview(String taskId) This endpoint request a review on the specified Task.org.springframework.http.ResponseEntity<TaskRepresentationModel>selectAndClaimTask(TaskQueryFilterParameter filterParameter, TaskQueryFilterCustomFields filterCustomFields, TaskQueryFilterCustomIntFields filterCustomIntFields, TaskController.TaskQuerySortParameter sortParameter) This endpoint selects the first Task returned by the Task Query and claims it.org.springframework.http.ResponseEntity<TaskRepresentationModel>setTaskRead(String taskId, IsReadRepresentationModel isRead) This endpoint sets the 'isRead' property of a Task.org.springframework.http.ResponseEntity<TaskRepresentationModel>terminateTask(String taskId) This endpoint terminates a Task.org.springframework.http.ResponseEntity<TaskRepresentationModel>transferTask(String taskId, String workbasketId, Boolean setTransferFlag) This endpoint transfers a given Task to a given Workbasket, if possible.org.springframework.http.ResponseEntity<TaskRepresentationModel>updateTask(String taskId, TaskRepresentationModel taskRepresentationModel) This endpoint updates a requested Task.
-
Method Details
-
createTask
@PostMapping(path="/api/v1/tasks") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> createTask(@RequestBody TaskRepresentationModel taskRepresentationModel) throws pro.taskana.workbasket.api.exceptions.WorkbasketNotFoundException, pro.taskana.classification.api.exceptions.ClassificationNotFoundException, pro.taskana.task.api.exceptions.TaskAlreadyExistException, pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.task.api.exceptions.AttachmentPersistenceException, pro.taskana.task.api.exceptions.ObjectReferencePersistenceException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint creates a persistent Task.- Parameters:
taskRepresentationModel- the Task which should be created.- Returns:
- the created Task
- Throws:
pro.taskana.workbasket.api.exceptions.WorkbasketNotFoundException- if the referenced Workbasket does not existpro.taskana.classification.api.exceptions.ClassificationNotFoundException- if the referenced Classification does not existpro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user is not authorized to append a Task to the referenced Workbasketpro.taskana.task.api.exceptions.TaskAlreadyExistException- if the requested Task already exists.pro.taskana.common.api.exceptions.InvalidArgumentException- if any input is semantically wrong.pro.taskana.task.api.exceptions.AttachmentPersistenceException- if an Attachment with ID will be added multiple times without using the task-methodspro.taskana.task.api.exceptions.ObjectReferencePersistenceException- if an ObjectReference with ID will be added multiple times without using the task-methods
-
getTasks
@GetMapping(path="/api/v1/tasks") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskSummaryPagedRepresentationModel> getTasks(jakarta.servlet.http.HttpServletRequest request, TaskQueryFilterParameter filterParameter, TaskQueryFilterCustomFields filterCustomFields, TaskQueryFilterCustomIntFields filterCustomIntFields, TaskQueryGroupByParameter groupByParameter, TaskController.TaskQuerySortParameter sortParameter, QueryPagingParameter<pro.taskana.task.api.models.TaskSummary, pro.taskana.task.api.TaskQuery> pagingParameter) This endpoint retrieves a list of existing Tasks. Filters can be applied.- Parameters:
request- the HTTP requestfilterParameter- the filter parametersfilterCustomFields- the filter parameters regarding TaskCustomFieldsfilterCustomIntFields- the filter parameters regarding TaskCustomIntFields * @paramgroupByParameter- the group by parameterssortParameter- the sort parameterspagingParameter- the paging parameters- Returns:
- the Tasks with the given filter, sort and paging options.
-
getTask
@GetMapping(path="/api/v1/tasks/{taskId}") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> getTask(@PathVariable String taskId) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint retrieves a specific Task.- Parameters:
taskId- the Id of the requested Task- Returns:
- the requested Task
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user is not authorized to get the requested Task.
-
claimTask
@PostMapping(path="/api/v1/tasks/{taskId}/claim") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> claimTask(@PathVariable String taskId, @RequestBody(required=false) String userName) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidOwnerException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException, pro.taskana.task.api.exceptions.InvalidTaskStateException This endpoint claims a Task if possible.- Parameters:
taskId- the Id of the Task which should be claimeduserName- TODO: this is currently not used- Returns:
- the claimed Task
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.task.api.exceptions.InvalidTaskStateException- if the state of the requested Task is not READY.pro.taskana.task.api.exceptions.InvalidOwnerException- if the Task is already claimed by someone else.pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no read permissions for the requested Task.
-
forceClaimTask
@PostMapping(path="/api/v1/tasks/{taskId}/claim/force") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> forceClaimTask(@PathVariable String taskId, @RequestBody(required=false) String userName) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.task.api.exceptions.InvalidOwnerException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint force claims a Task if possible even if it is already claimed by someone else.- Parameters:
taskId- the Id of the Task which should be force claimeduserName- TODO: this is currently not used- Returns:
- the force claimed Task
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.task.api.exceptions.InvalidTaskStateException- if the state of Task with taskId is in an END_STATE.pro.taskana.task.api.exceptions.InvalidOwnerException- cannot be thrown.pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no read permissions for the requested Task.
-
selectAndClaimTask
@PostMapping(path="/api/v1/tasks/select-and-claim") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> selectAndClaimTask(TaskQueryFilterParameter filterParameter, TaskQueryFilterCustomFields filterCustomFields, TaskQueryFilterCustomIntFields filterCustomIntFields, TaskController.TaskQuerySortParameter sortParameter) throws pro.taskana.task.api.exceptions.InvalidOwnerException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint selects the first Task returned by the Task Query and claims it.- Parameters:
filterParameter- the filter parametersfilterCustomFields- the filter parameters regarding TaskCustomFieldsfilterCustomIntFields- the filter parameters regarding TaskCustomIntFieldssortParameter- the sort parameters- Returns:
- the claimed Task or 404 if no Task is found
- Throws:
pro.taskana.task.api.exceptions.InvalidOwnerException- if the Task is already claimed by someone elsepro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no read permission for the Workbasket the Task is in
-
cancelClaimTask
@DeleteMapping(path="/api/v1/tasks/{taskId}/claim") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> cancelClaimTask(@PathVariable String taskId, @RequestParam(defaultValue="false") boolean keepOwner) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.task.api.exceptions.InvalidOwnerException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint cancels the claim of an existing Task if it was claimed by the current user before.- Parameters:
taskId- the Id of the requested Task.keepOwner- flag whether or not to keep the owner despite the cancel claim- Returns:
- the unclaimed Task.
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.task.api.exceptions.InvalidTaskStateException- if the Task is already in an end state.pro.taskana.task.api.exceptions.InvalidOwnerException- if the Task is claimed by a different user.pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no read permission for the Workbasket the Task is in
-
forceCancelClaimTask
@DeleteMapping(path="/api/v1/tasks/{taskId}/claim/force") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> forceCancelClaimTask(@PathVariable String taskId, @RequestParam(defaultValue="false") boolean keepOwner) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.task.api.exceptions.InvalidOwnerException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint force cancels the claim of an existing Task.- Parameters:
taskId- the Id of the requested Task.keepOwner- flag whether or not to keep the owner despite the cancel claim- Returns:
- the unclaimed Task.
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.task.api.exceptions.InvalidTaskStateException- if the Task is already in an end state.pro.taskana.task.api.exceptions.InvalidOwnerException- if the Task is claimed by a different user.pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no read permission for the Workbasket the Task is in
-
requestReview
@PostMapping(path="/api/v1/tasks/{taskId}/request-review") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> requestReview(@PathVariable String taskId) throws pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidOwnerException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint request a review on the specified Task.- Parameters:
taskId- taskId the id of the relevant Task- Returns:
- the Task after a review has been requested
- Throws:
pro.taskana.task.api.exceptions.InvalidTaskStateException- if the state of the Task with taskId is not CLAIMEDpro.taskana.task.api.exceptions.TaskNotFoundException- if the Task with taskId wasn't foundpro.taskana.task.api.exceptions.InvalidOwnerException- if the Task is claimed by another userpro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no READ permissions for the Workbasket the Task is in
-
forceRequestReview
@PostMapping(path="/api/v1/tasks/{taskId}/request-review/force") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> forceRequestReview(@PathVariable String taskId) throws pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidOwnerException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint force request a review on the specified Task.- Parameters:
taskId- taskId the id of the relevant Task- Returns:
- the Task after a review has been requested
- Throws:
pro.taskana.task.api.exceptions.InvalidTaskStateException- if the state of the Task with taskId is not CLAIMEDpro.taskana.task.api.exceptions.TaskNotFoundException- if the Task with taskId wasn't foundpro.taskana.task.api.exceptions.InvalidOwnerException- cannot be thrownpro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no READ permissions for the Workbasket the Task is in
-
requestChanges
@PostMapping(path="/api/v1/tasks/{taskId}/request-changes") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> requestChanges(@PathVariable String taskId) throws pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidOwnerException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint request changes on the specified Task.- Parameters:
taskId- the id of the relevant Task- Returns:
- the Task after changes have been requested
- Throws:
pro.taskana.task.api.exceptions.InvalidTaskStateException- if the state of the Task with taskId is not IN_REVIEWpro.taskana.task.api.exceptions.TaskNotFoundException- if the Task with taskId wasn't foundpro.taskana.task.api.exceptions.InvalidOwnerException- if the Task is claimed by another userpro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no READ permissions for the Workbasket the Task is in
-
forceRequestChanges
@PostMapping(path="/api/v1/tasks/{taskId}/request-changes/force") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> forceRequestChanges(@PathVariable String taskId) throws pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidOwnerException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint force requests changes on a Task.- Parameters:
taskId- the Id of the Task on which a review should be requested- Returns:
- the change requested Task
- Throws:
pro.taskana.task.api.exceptions.InvalidTaskStateException- if the Task with taskId is in an end statepro.taskana.task.api.exceptions.TaskNotFoundException- if the Task with taskId wasn't foundpro.taskana.task.api.exceptions.InvalidOwnerException- cannot be thrownpro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no READ permissions for the Workbasket the Task is in
-
completeTask
@PostMapping(path="/api/v1/tasks/{taskId}/complete") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> completeTask(@PathVariable String taskId) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidOwnerException, pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint completes a Task.- Parameters:
taskId- Id of the requested Task to complete.- Returns:
- the completed Task
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.task.api.exceptions.InvalidOwnerException- if current user is not the owner of the Task or an administrator.pro.taskana.task.api.exceptions.InvalidTaskStateException- if Task wasn't claimed previously.pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no read permission for the Workbasket the Task is in
-
forceCompleteTask
@PostMapping(path="/api/v1/tasks/{taskId}/complete/force") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> forceCompleteTask(@PathVariable String taskId) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidOwnerException, pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint force completes a Task.- Parameters:
taskId- Id of the requested Task to force complete.- Returns:
- the force completed Task
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.task.api.exceptions.InvalidOwnerException- cannot be thrown.pro.taskana.task.api.exceptions.InvalidTaskStateException- if the state of the Task with taskId is TERMINATED or CANCELEDpro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no read permission for the Workbasket the Task is in
-
cancelTask
@PostMapping(path="/api/v1/tasks/{taskId}/cancel") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> cancelTask(@PathVariable String taskId) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException, pro.taskana.task.api.exceptions.InvalidTaskStateException This endpoint cancels a Task. Cancellation marks a Task as obsolete. The actual work the Task was referring to is no longer required- Parameters:
taskId- Id of the requested Task to cancel.- Returns:
- the cancelled Task
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.task.api.exceptions.InvalidTaskStateException- if the task is not in state READY or CLAIMEDpro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no read permission for the Workbasket the Task is in
-
terminateTask
@PostMapping(path="/api/v1/tasks/{taskId}/terminate") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> terminateTask(@PathVariable String taskId) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.common.api.exceptions.NotAuthorizedException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint terminates a Task. Termination is an administrative action to complete a Task.- Parameters:
taskId- Id of the requested Task to terminate.- Returns:
- the terminated Task
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.task.api.exceptions.InvalidTaskStateException- if the task is not in state READY or CLAIMEDpro.taskana.common.api.exceptions.NotAuthorizedException- if the current user isn't an administrator (ADMIN/TASKADMIN)pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has not correct permissions
-
transferTask
@PostMapping(path="/api/v1/tasks/{taskId}/transfer/{workbasketId}") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> transferTask(@PathVariable String taskId, @PathVariable String workbasketId, @RequestBody(required=false) Boolean setTransferFlag) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.workbasket.api.exceptions.WorkbasketNotFoundException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException, pro.taskana.task.api.exceptions.InvalidTaskStateException This endpoint transfers a given Task to a given Workbasket, if possible.- Parameters:
taskId- the Id of the Task which should be transferredworkbasketId- the Id of the destination WorkbasketsetTransferFlag- sets the tansfer flag of the task (default: true)- Returns:
- the successfully transferred Task.
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not existpro.taskana.workbasket.api.exceptions.WorkbasketNotFoundException- if the requested Workbasket does not existpro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no authorization to transfer the Task.pro.taskana.task.api.exceptions.InvalidTaskStateException- if the Task is in a state which does not allow transferring.
-
updateTask
@PutMapping(path="/api/v1/tasks/{taskId}") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> updateTask(@PathVariable("taskId") String taskId, @RequestBody TaskRepresentationModel taskRepresentationModel) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.classification.api.exceptions.ClassificationNotFoundException, pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.common.api.exceptions.ConcurrencyException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException, pro.taskana.task.api.exceptions.AttachmentPersistenceException, pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.task.api.exceptions.ObjectReferencePersistenceException This endpoint updates a requested Task.- Parameters:
taskId- the Id of the Task which should be updatedtaskRepresentationModel- the new Task for the requested id.- Returns:
- the updated Task
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.classification.api.exceptions.ClassificationNotFoundException- if the updated Classification does not exist.pro.taskana.common.api.exceptions.InvalidArgumentException- if any semantically invalid parameter was providedpro.taskana.common.api.exceptions.ConcurrencyException- if the Task has been updated by a different process in the meantimepro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user is not authorized.pro.taskana.task.api.exceptions.AttachmentPersistenceException- if the modified Task contains two attachments with the same id.pro.taskana.task.api.exceptions.ObjectReferencePersistenceException- if the modified Task contains two object references with the same id.pro.taskana.task.api.exceptions.InvalidTaskStateException- if an attempt is made to change the owner of the Task and the Task is not in state READY.
-
setTaskRead
@PostMapping(path="/api/v1/tasks/{taskId}/set-read") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> setTaskRead(@PathVariable String taskId, @RequestBody IsReadRepresentationModel isRead) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException This endpoint sets the 'isRead' property of a Task.- Parameters:
taskId- Id of the requested Task to set read or unread.isRead- if true, the Task property isRead is set to true, else it's set to false- Returns:
- the updated Task
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has no read permission for the Workbasket the Task is in
-
deleteTask
@DeleteMapping(path="/api/v1/tasks/{taskId}") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> deleteTask(@PathVariable String taskId) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.common.api.exceptions.NotAuthorizedException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException, pro.taskana.task.api.exceptions.InvalidCallbackStateException This endpoint deletes a Task.- Parameters:
taskId- the Id of the Task which should be deleted.- Returns:
- the deleted Task.
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.task.api.exceptions.InvalidTaskStateException- If the Task is not in an END_STATEpro.taskana.common.api.exceptions.NotAuthorizedException- if the current user isn't an administrator (ADMIN)pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has not correct permissionspro.taskana.task.api.exceptions.InvalidCallbackStateException- some comment
-
forceDeleteTask
@DeleteMapping(path="/api/v1/tasks/{taskId}/force") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskRepresentationModel> forceDeleteTask(@PathVariable String taskId) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.InvalidTaskStateException, pro.taskana.common.api.exceptions.NotAuthorizedException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException, pro.taskana.task.api.exceptions.InvalidCallbackStateException This endpoint force deletes a Task even if it's not completed.- Parameters:
taskId- the Id of the Task which should be force deleted.- Returns:
- the force deleted Task.
- Throws:
pro.taskana.task.api.exceptions.TaskNotFoundException- if the requested Task does not exist.pro.taskana.task.api.exceptions.InvalidTaskStateException- If the Task is not TERMINATED or CANCELLED and the Callback state of the Task is CALLBACK_PROCESSING_REQUIREDpro.taskana.common.api.exceptions.NotAuthorizedException- if the current user isn't an administrator (ADMIN) Task.pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has not correctpro.taskana.task.api.exceptions.InvalidCallbackStateException- some comment
-
deleteTasks
@DeleteMapping(path="/api/v1/tasks") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskSummaryCollectionRepresentationModel> deleteTasks(TaskQueryFilterParameter filterParameter, TaskQueryFilterCustomFields filterCustomFields, TaskQueryFilterCustomIntFields filterCustomIntFields) throws pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.common.api.exceptions.NotAuthorizedException This endpoint deletes an aggregation of Tasks and returns the deleted Tasks. Filters can be applied.- Parameters:
filterParameter- the filter parametersfilterCustomFields- the filter parameters regarding TaskCustomFieldsfilterCustomIntFields- the filter parameters regarding TaskCustomIntFields- Returns:
- the deleted task summaries
- Throws:
pro.taskana.common.api.exceptions.InvalidArgumentException- TODO: this is never thrownpro.taskana.common.api.exceptions.NotAuthorizedException- if the current user is not authorized to delete the requested Tasks.
-