forked from camunda/camunda-bpm-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add update and delete comment Java/Rest APIs (camunda#4565)
DELETE /task/{taskId}/comment/{commentId} - deletes a comment of a given taskId and commentId DELETE /task/{taskId}/comment - deletes all comments of a given taskId PUT /task/comment - updates a comment DELETE /process-instance/{processInstanceId}/comment/{commentId} - deletes a comment of a given processInstanceId and commentId DELETE /process-instance/{processInstanceId}/comment. - deletes all comments of a given processInstanceId PUT /process-instance/comment - updates a comment related to: camunda#2551 --------- Co-authored-by: Prajwol Bhandari <prajwol.bhandari@fmr.com> Co-authored-by: <yanavasileva@users.noreply.github.com>
- Loading branch information
1 parent
091ec02
commit 536442d
Showing
49 changed files
with
2,952 additions
and
71 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...est/engine-rest-openapi/src/main/templates/paths/process-instance/{id}/comment/delete.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<#macro endpoint_macro docsUrl=""> | ||
{ | ||
<@lib.endpointInfo | ||
id = "deleteProcessInstanceComments" | ||
tag = "Process Instance Comment" | ||
summary = "Delete ProcessInstance Comments" | ||
desc = "Deletes all comments of a process instance by id." /> | ||
|
||
"parameters": [ | ||
|
||
<@lib.parameter | ||
name = "id" | ||
location = "path" | ||
type = "string" | ||
required = true | ||
last = true | ||
desc = "The id of the process instance for which all comments are to be deleted."/> | ||
|
||
], | ||
"responses": { | ||
|
||
<@lib.response | ||
code = "204" | ||
desc = "Request successful." /> | ||
|
||
<@lib.response | ||
code = "403" | ||
dto = "AuthorizationExceptionDto" | ||
desc = "The authenticated user is unauthorized to delete this resource. See the | ||
[Introduction](${docsUrl}/reference/rest/overview/#error-handling) | ||
for the error response format."/> | ||
|
||
<@lib.response | ||
code = "400" | ||
dto = "ExceptionDto" | ||
last = true | ||
desc = "Process instance doesn't exist or history is not enabled. | ||
See the [Introduction](${docsUrl}/reference/rest/overview/#error-handling) | ||
for the error response format." /> | ||
|
||
} | ||
} | ||
</#macro> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
...e-rest/engine-rest-openapi/src/main/templates/paths/process-instance/{id}/comment/put.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<#macro endpoint_macro docsUrl=""> | ||
{ | ||
|
||
<@lib.endpointInfo | ||
id = "updateProcessInstanceComment" | ||
tag = "Process Instance Comment" | ||
summary = "Update" | ||
desc = "Updates a Comment." /> | ||
|
||
"parameters" : [ | ||
|
||
<@lib.parameter | ||
name = "id" | ||
location = "path" | ||
type = "string" | ||
required = true | ||
last = true | ||
desc = "The id associated of a process instance of a comment to be updated."/> | ||
|
||
], | ||
|
||
<@lib.requestBody | ||
mediaType = "application/json" | ||
dto = "CommentDto" | ||
requestDesc = "**Note:** Only the `id` and `message` properties will be used. Every other | ||
property passed to this endpoint will be ignored." | ||
examples = ['"example-1": { | ||
"summary": "PUT /process-instance/aProcessInstanceId/comment", | ||
"value": { | ||
"id": "75bc161a-12da-11e4-7d3a-f4ccdc10a445", | ||
"message": "a process instance comment" | ||
} | ||
}'] /> | ||
|
||
"responses" : { | ||
|
||
<@lib.response | ||
code = "204" | ||
desc = "Request successful." /> | ||
|
||
<@lib.response | ||
code = "400" | ||
dto = "ExceptionDto" | ||
desc = "Returned if a given process instance id or comment id is invalid or history is disabled in the engine. | ||
See the [Introduction](${docsUrl}/reference/rest/overview/#error-handling) for the error response format."/> | ||
|
||
<@lib.response | ||
code = "404" | ||
dto = "AuthorizationExceptionDto" | ||
last = true | ||
desc = "The authenticated user is unauthorized to update this resource. See the | ||
[Introduction](${docsUrl}/reference/rest/overview/#error-handling) | ||
for the error response format." /> | ||
|
||
} | ||
} | ||
|
||
</#macro> |
52 changes: 52 additions & 0 deletions
52
...est-openapi/src/main/templates/paths/process-instance/{id}/comment/{commentId}/delete.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<#macro endpoint_macro docsUrl=""> | ||
{ | ||
|
||
<@lib.endpointInfo | ||
id = "deleteProcessInstanceComment" | ||
tag = "Process Instance Comment" | ||
summary = "Delete" | ||
desc = "Removes a comment from a process instance by id." /> | ||
|
||
"parameters" : [ | ||
|
||
<@lib.parameter | ||
name = "id" | ||
location = "path" | ||
type = "string" | ||
required = true | ||
desc = "The id of the process instance." /> | ||
|
||
<@lib.parameter | ||
name = "commentId" | ||
location = "path" | ||
type = "string" | ||
required = true | ||
last = true | ||
desc = "The id of the comment to be removed." /> | ||
|
||
], | ||
|
||
"responses" : { | ||
|
||
<@lib.response | ||
code = "204" | ||
desc = "Request successful." /> | ||
|
||
<@lib.response | ||
code = "400" | ||
dto = "ExceptionDto" | ||
desc = "Returned if a given process instance id or comment id is invalid or history is disabled in the engine. | ||
See the [Introduction](${docsUrl}/reference/rest/overview/#error-handling) for the error response format."/> | ||
|
||
<@lib.response | ||
code = "404" | ||
dto = "AuthorizationExceptionDto" | ||
last = true | ||
desc = "The authenticated user is unauthorized to delete this resource. See the | ||
[Introduction](${docsUrl}/reference/rest/overview/#error-handling) | ||
for the error response format." /> | ||
|
||
} | ||
} | ||
|
||
</#macro> |
43 changes: 43 additions & 0 deletions
43
engine-rest/engine-rest-openapi/src/main/templates/paths/task/{id}/comment/delete.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<#macro endpoint_macro docsUrl=""> | ||
{ | ||
<@lib.endpointInfo | ||
id = "deleteTaskComments" | ||
tag = "Task Comment" | ||
summary = "Delete Task Comments" | ||
desc = "Deletes all comments of a task by task id." /> | ||
|
||
"parameters": [ | ||
|
||
<@lib.parameter | ||
name = "id" | ||
location = "path" | ||
type = "string" | ||
required = true | ||
last = true | ||
desc = "The id of the task for which all comments are to be deleted."/> | ||
|
||
], | ||
"responses": { | ||
|
||
<@lib.response | ||
code = "204" | ||
desc = "Request successful." /> | ||
|
||
<@lib.response | ||
code = "400" | ||
dto = "ExceptionDto" | ||
desc = "Returned if a given task id is invalid. Orhe history of the engine is disabled. | ||
See the [Introduction](${docsUrl}/reference/rest/overview/#error-handling) for the error response format."/> | ||
|
||
<@lib.response | ||
code = "404" | ||
dto = "AuthorizationExceptionDto" | ||
last = true | ||
desc = "The authenticated user is unauthorized to delete this resource. See the | ||
[Introduction](${docsUrl}/reference/rest/overview/#error-handling) | ||
for the error response format." | ||
/> | ||
|
||
} | ||
} | ||
</#macro> |
58 changes: 58 additions & 0 deletions
58
engine-rest/engine-rest-openapi/src/main/templates/paths/task/{id}/comment/put.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<#macro endpoint_macro docsUrl=""> | ||
{ | ||
|
||
<@lib.endpointInfo | ||
id = "updateTaskComment" | ||
tag = "Task Comment" | ||
summary = "Update" | ||
desc = "Updates a Comment." /> | ||
|
||
"parameters" : [ | ||
|
||
<@lib.parameter | ||
name = "id" | ||
location = "path" | ||
type = "string" | ||
required = true | ||
last = true | ||
desc = "The id associated of a task of a comment to be updated."/> | ||
|
||
], | ||
|
||
<@lib.requestBody | ||
mediaType = "application/json" | ||
dto = "CommentDto" | ||
requestDesc = "**Note:** Only the `id` and `message` properties will be used. Every other | ||
property passed to this endpoint will be ignored." | ||
examples = ['"example-1": { | ||
"summary": "PUT /task/aTaskId/comment", | ||
"value": { | ||
"id": "86cd272a-23ea-22e5-8e4a-e5bded20a556", | ||
"message": "a task comment" | ||
} | ||
}'] /> | ||
|
||
"responses" : { | ||
|
||
<@lib.response | ||
code = "204" | ||
desc = "Request successful." /> | ||
|
||
<@lib.response | ||
code = "400" | ||
dto = "ExceptionDto" | ||
desc = "Returned if a given task id or comment id is invalid. Or the history of the engine is disabled. | ||
See the [Introduction](${docsUrl}/reference/rest/overview/#error-handling) for the error response format."/> | ||
|
||
<@lib.response | ||
code = "404" | ||
dto = "AuthorizationExceptionDto" | ||
last = true | ||
desc = "The authenticated user is unauthorized to update this resource. See the | ||
[Introduction](${docsUrl}/reference/rest/overview/#error-handling) | ||
for the error response format."/> | ||
|
||
} | ||
} | ||
|
||
</#macro> |
52 changes: 52 additions & 0 deletions
52
...est/engine-rest-openapi/src/main/templates/paths/task/{id}/comment/{commentId}/delete.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<#macro endpoint_macro docsUrl=""> | ||
{ | ||
|
||
<@lib.endpointInfo | ||
id = "deleteTaskComment" | ||
tag = "Task Comment" | ||
summary = "Delete" | ||
desc = "Removes a comment from a task by id." /> | ||
|
||
"parameters" : [ | ||
|
||
<@lib.parameter | ||
name = "id" | ||
location = "path" | ||
type = "string" | ||
required = true | ||
desc = "The id of the task." /> | ||
|
||
<@lib.parameter | ||
name = "commentId" | ||
location = "path" | ||
type = "string" | ||
required = true | ||
last = true | ||
desc = "The id of the comment to be removed." /> | ||
|
||
], | ||
|
||
"responses" : { | ||
|
||
<@lib.response | ||
code = "204" | ||
desc = "Request successful." /> | ||
|
||
<@lib.response | ||
code = "400" | ||
dto = "ExceptionDto" | ||
desc = "Returned if a given task id or comment id is invalid. Or history of the engine is disabled. | ||
See the [Introduction](${docsUrl}/reference/rest/overview/#error-handling) for the error response format."/> | ||
|
||
<@lib.response | ||
code = "404" | ||
dto = "AuthorizationExceptionDto" | ||
last = true | ||
desc = "The authenticated user is unauthorized to delete this resource. See the | ||
[Introduction](${docsUrl}/reference/rest/overview/#error-handling) | ||
for the error response format."/> | ||
|
||
} | ||
} | ||
|
||
</#macro> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.