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(openapi): add user operation log endpoints
Related to CAM-11569
- Loading branch information
1 parent
990a063
commit a4c0a92
Showing
7 changed files
with
581 additions
and
0 deletions.
There are no files selected for viewing
117 changes: 117 additions & 0 deletions
117
...st/engine-rest-openapi/src/main/templates/lib/commons/user-operation-log-query-params.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,117 @@ | ||
<#assign sortByValues = [ | ||
'"timestamp"' | ||
]> | ||
<#assign dateFormatDescription = "By [default](${docsUrl}/reference/rest/overview/date-format/), the | ||
timestamp must have the format `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, | ||
e.g., 2013-01-23T14:42:45.000+0200."/> | ||
<#if requestMethod == "GET"> | ||
<#assign listType = "comma-separated "> | ||
<#elseif requestMethod == "POST"> | ||
<#assign listType = ""> | ||
</#if> | ||
|
||
<#assign params = { | ||
"deploymentId": { | ||
"type": "string", | ||
"desc": "Filter by deployment id." | ||
}, | ||
"processDefinitionId": { | ||
"type": "string", | ||
"desc": "Filter by process definition id." | ||
}, | ||
"processDefinitionKey": { | ||
"type": "string", | ||
"desc": "Filter by process definition key." | ||
}, | ||
"processInstanceId": { | ||
"type": "string", | ||
"desc": "Filter by process instance id." | ||
}, | ||
"executionId": { | ||
"type": "string", | ||
"desc": "Filter by execution id." | ||
}, | ||
"caseDefinitionId": { | ||
"type": "string", | ||
"desc": "Filter by case definition id." | ||
}, | ||
"caseInstanceId": { | ||
"type": "string", | ||
"desc": "Filter by case instance id." | ||
}, | ||
"caseExecutionId": { | ||
"type": "string", | ||
"desc": "Filter by case execution id." | ||
}, | ||
"taskId": { | ||
"type": "string", | ||
"desc": "Only include operations on this task." | ||
}, | ||
"externalTaskId": { | ||
"type": "string", | ||
"desc": "Only include operations on this external task." | ||
}, | ||
"batchId": { | ||
"type": "string", | ||
"desc": "Only include operations on this batch." | ||
}, | ||
"jobId": { | ||
"type": "string", | ||
"desc": "Filter by job id." | ||
}, | ||
"jobDefinitionId": { | ||
"type": "string", | ||
"desc": "Filter by job definition id." | ||
}, | ||
"userId": { | ||
"type": "string", | ||
"desc": "Only include operations of this user." | ||
}, | ||
"operationId": { | ||
"type": "string", | ||
"desc": "Filter by the id of the operation. This allows fetching of multiple entries which are part | ||
of a composite operation." | ||
}, | ||
"operationType": { | ||
"type": "string", | ||
"desc": "Filter by the type of the operation like `Claim` or `Delegate`. See the | ||
[Javadoc](${docsUrl}/reference/javadoc/?org/camunda/bpm/engine/history/UserOperationLogEntry.html) | ||
for a list of available operation types." | ||
}, | ||
"entityType": { | ||
"type": "string", | ||
"desc": "Filter by the type of the entity that was affected by this operation, possible values are | ||
`Task`, `Attachment` or `IdentityLink`." | ||
}, | ||
"entityTypeIn": { | ||
"type": "array", | ||
"itemType": "string", | ||
"desc": "Filter by a ${listType}list of types of the entities that was affected by this operation, | ||
possible values are `Task`, `Attachment` or `IdentityLink`." | ||
}, | ||
"category": { | ||
"type": "string", | ||
"desc": "Filter by the category that this operation is associated with, possible values are | ||
`TaskWorker`, `Admin` or `Operator`." | ||
}, | ||
"categoryIn": { | ||
"type": "array", | ||
"itemType": "string", | ||
"desc": "Filter by a ${listType}list of categories that this operation is associated with, possible values are | ||
`TaskWorker`, `Admin` or `Operator`." | ||
}, | ||
"property": { | ||
"type": "string", | ||
"desc": "Only include operations that changed this property, e.g., `owner` or `assignee`." | ||
}, | ||
"afterTimestamp": { | ||
"type": "string", | ||
"format": "date-time", | ||
"desc": "Restrict to entries that were created after the given timestamp. ${dateFormatDescription}" | ||
}, | ||
"beforeTimestamp": { | ||
"type": "string", | ||
"format": "date-time", | ||
"desc": "Restrict to entries that were created before the given timestamp. ${dateFormatDescription}" | ||
} | ||
}> |
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
179 changes: 179 additions & 0 deletions
179
...ain/templates/models/org/camunda/bpm/engine/rest/dto/history/UserOperationLogEntryDto.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,179 @@ | ||
<#macro dto_macro docsUrl=""> | ||
<@lib.dto > | ||
|
||
<@lib.property | ||
name = "id" | ||
type = "string" | ||
desc = "The unique identifier of this log entry." | ||
/> | ||
|
||
<@lib.property | ||
name = "userId" | ||
type = "string" | ||
desc = "The user who performed this operation." | ||
/> | ||
|
||
<@lib.property | ||
name = "timestamp" | ||
type = "string" | ||
format = "date-time" | ||
desc = "Timestamp of this operation." | ||
/> | ||
|
||
<@lib.property | ||
name = "operationId" | ||
type = "string" | ||
desc = "The unique identifier of this operation. A composite operation that changes | ||
multiple properties has a common `operationId`." | ||
/> | ||
|
||
<@lib.property | ||
name = "operationType" | ||
type = "string" | ||
desc = "The type of this operation, e.g., `Assign`, `Claim` and so on." | ||
/> | ||
|
||
<@lib.property | ||
name = "entityType" | ||
type = "string" | ||
desc = "The type of the entity on which this operation was executed, e.g., `Task` or | ||
`Attachment`." | ||
/> | ||
|
||
<@lib.property | ||
name = "category" | ||
type = "string" | ||
desc = "The name of the category this operation was associated with, e.g., `TaskWorker` or | ||
`Admin`." | ||
/> | ||
|
||
<@lib.property | ||
name = "annotation" | ||
type = "string" | ||
desc = "An arbitrary annotation set by a user for auditing reasons." | ||
/> | ||
|
||
<@lib.property | ||
name = "property" | ||
type = "string" | ||
desc = "The property changed by this operation." | ||
/> | ||
|
||
<@lib.property | ||
name = "orgValue" | ||
type = "string" | ||
desc = "The original value of the changed property." | ||
/> | ||
|
||
<@lib.property | ||
name = "newValue" | ||
type = "string" | ||
desc = "The new value of the changed property." | ||
/> | ||
|
||
<@lib.property | ||
name = "deploymentId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this | ||
deployment." | ||
/> | ||
|
||
<@lib.property | ||
name = "processDefinitionId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this process | ||
definition." | ||
/> | ||
|
||
<@lib.property | ||
name = "processDefinitionKey" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to process | ||
definitions with this key." | ||
/> | ||
|
||
<@lib.property | ||
name = "processInstanceId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this process | ||
instance." | ||
/> | ||
|
||
<@lib.property | ||
name = "executionId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this | ||
execution." | ||
/> | ||
|
||
<@lib.property | ||
name = "caseDefinitionId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this case | ||
definition." | ||
/> | ||
|
||
<@lib.property | ||
name = "caseInstanceId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this case | ||
instance." | ||
/> | ||
|
||
<@lib.property | ||
name = "caseExecutionId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this case | ||
execution." | ||
/> | ||
|
||
<@lib.property | ||
name = "taskId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this task." | ||
/> | ||
|
||
<@lib.property | ||
name = "externalTaskId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this external task." | ||
/> | ||
|
||
<@lib.property | ||
name = "batchId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this batch." | ||
/> | ||
|
||
<@lib.property | ||
name = "jobId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this job." | ||
/> | ||
|
||
<@lib.property | ||
name = "jobDefinitionId" | ||
type = "string" | ||
desc = "If not `null`, the operation is restricted to entities in relation to this job | ||
definition." | ||
/> | ||
|
||
<@lib.property | ||
name = "removalTime" | ||
type = "string" | ||
format = "date-time" | ||
desc = "The time after which the entry should be removed by the History Cleanup job. | ||
[Default format](${docsUrl}/reference/rest/overview/date-format/) | ||
`yyyy-MM-dd'T'HH:mm:ss.SSSZ`." | ||
/> | ||
|
||
<@lib.property | ||
name = "rootProcessInstanceId" | ||
type = "string" | ||
desc = "The process instance id of the root process instance that initiated the process | ||
containing this entry." | ||
last = true | ||
/> | ||
|
||
</@lib.dto> | ||
</#macro> |
53 changes: 53 additions & 0 deletions
53
...ne-rest/engine-rest-openapi/src/main/templates/paths/history/user-operation/count/get.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,53 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/user-operation-log/get-user-operation-log-query-count/index.html --> | ||
<#macro endpoint_macro docsUrl=""> | ||
{ | ||
<@lib.endpointInfo | ||
id = "queryUserOperationCount" | ||
tag = "Historic User Operation Log" | ||
summary = "Get User Operation Log Count" | ||
desc = "Queries for the number of user operation log entries that fulfill the given parameters. | ||
Takes the same parameters as the | ||
[Get User Operation Log (Historic)](${docsUrl}/reference/rest/history/user-operation-log/get-user-operation-log-query/) | ||
method." | ||
/> | ||
|
||
"parameters" : [ | ||
|
||
<#assign last = true > | ||
<#assign requestMethod="GET"/> | ||
<#include "/lib/commons/user-operation-log-query-params.ftl" > | ||
<@lib.parameters | ||
object = params | ||
last = last | ||
/> | ||
|
||
], | ||
|
||
"responses": { | ||
|
||
<@lib.response | ||
code = "200" | ||
dto = "CountResultDto" | ||
desc = "Request successful." | ||
examples = ['"example-1": { | ||
"summary": "GET `/history/user-operation?operationType=Claim&userId=demo`", | ||
"description": "GET `/history/user-operation?operationType=Claim&userId=demo`", | ||
"value": { | ||
"count": 1 | ||
} | ||
}'] | ||
/> | ||
|
||
<@lib.response | ||
code = "400" | ||
dto = "ExceptionDto" | ||
desc = "Returned if some of the query parameters are invalid. See the | ||
[Introduction](${docsUrl}/reference/rest/overview/#error-handling) | ||
for the error response format." | ||
last = true | ||
/> | ||
|
||
} | ||
|
||
} | ||
</#macro> |
Oops, something went wrong.