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 OpenAPI docs for Historic Variable Instance endpoint
Related to CAM-11570 Co-authored-by: Tobias Metzke-Bernstein <tobias.metzke@camunda.com>
- Loading branch information
Showing
13 changed files
with
731 additions
and
2 deletions.
There are no files selected for viewing
110 changes: 110 additions & 0 deletions
110
...e-rest-openapi/src/main/templates/lib/commons/historic-variable-instance-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,110 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/variable-instance/get-variable-instance-query/index.html --> | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/variable-instance/post-variable-instance-query/index.html --> | ||
|
||
<#assign sortByValues = [ | ||
'"instanceId"','"variableName"','"tenantId"' | ||
]> | ||
|
||
<#if requestMethod == "GET"> | ||
<#assign variableValueDescription = "Is treated as a `String` object on server side."> | ||
<#assign paramListType = "and comma-separated"> | ||
<#elseif requestMethod == "POST"> | ||
<#assign variableValueDescription = "May be `String`, `Number` or `Boolean`."> | ||
<#assign paramListType = ""> | ||
</#if> | ||
|
||
<#assign params = { | ||
"variableName": { | ||
"type": "string", | ||
"desc": "Filter by variable name." | ||
}, | ||
"variableNameLike": { | ||
"type": "string", | ||
"desc": "Restrict to variables with a name like the parameter." | ||
}, | ||
"variableValue": { | ||
"type": "object", | ||
"desc": "Filter by variable value. ${variableValueDescription}" | ||
}, | ||
"variableNamesIgnoreCase": { | ||
"type": "boolean", | ||
"desc": "Match the variable name provided in `variableName` and `variableNameLike` case- | ||
insensitively. If set to `true` **variableName** and **variablename** are | ||
treated as equal." | ||
}, | ||
"variableValuesIgnoreCase": { | ||
"type": "boolean", | ||
"desc": "Match the variable value provided in `variableValue` case-insensitively. If set to `true` | ||
**variableValue** and **variablevalue** are treated as equal." | ||
}, | ||
"variableTypeIn": { | ||
"type": "array", | ||
"itemType": "string", | ||
"desc": "Only include historic variable instances which belong to one of the passed and comma- | ||
separated variable types. A list of all supported variable types can be found | ||
[here](${docsUrl}/user-guide/process-engine/variables/#supported-variable-values). | ||
**Note:** All non-primitive variables are associated with the type | ||
'serializable'." | ||
}, | ||
"includeDeleted": { | ||
"type": "boolean", | ||
"desc": "Include variables that has already been deleted during the execution." | ||
}, | ||
"processInstanceId": { | ||
"type": "string", | ||
"desc": "Filter by the process instance the variable belongs to." | ||
}, | ||
"processInstanceIdIn": { | ||
"type": "array", | ||
"itemType": "string", | ||
"desc": "Only include historic variable instances which belong to one of the passed ${paramListType} process instance ids." | ||
}, | ||
"processDefinitionId": { | ||
"type": "string", | ||
"desc": "Filter by the process definition the variable belongs to." | ||
}, | ||
"processDefinitionKey": { | ||
"type": "string", | ||
"desc": "Filter by a key of the process definition the variable belongs to." | ||
}, | ||
"executionIdIn": { | ||
"type": "array", | ||
"itemType": "string", | ||
"desc": "Only include historic variable instances which belong to one of the passed and ${paramListType} execution ids." | ||
}, | ||
"caseInstanceId": { | ||
"type": "string", | ||
"desc": "Filter by the case instance the variable belongs to." | ||
}, | ||
"caseExecutionIdIn": { | ||
"type": "array", | ||
"itemType": "string", | ||
"desc": "Only include historic variable instances which belong to one of the passed and ${paramListType} case execution ids." | ||
}, | ||
"caseActivityIdIn": { | ||
"type": "array", | ||
"itemType": "string", | ||
"desc": "Only include historic variable instances which belong to one of the passed and ${paramListType} case activity ids." | ||
}, | ||
"taskIdIn": { | ||
"type": "array", | ||
"itemType": "string", | ||
"desc": "Only include historic variable instances which belong to one of the passed and ${paramListType} task ids." | ||
}, | ||
"activityInstanceIdIn": { | ||
"type": "array", | ||
"itemType": "string", | ||
"desc": "Only include historic variable instances which belong to one of the passed and ${paramListType} activity instance ids." | ||
}, | ||
"tenantIdIn": { | ||
"type": "array", | ||
"itemType": "string", | ||
"desc": "Only include historic variable instances which belong to one of the passed and comma- | ||
separated tenant ids." | ||
}, | ||
"withoutTenantId": { | ||
"type": "boolean", | ||
"desc": "Only include historic variable instances that belong to no tenant. Value may only be | ||
`true`, as `false` is the default behavior." | ||
} | ||
}> |
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
120 changes: 120 additions & 0 deletions
120
.../templates/models/org/camunda/bpm/engine/rest/dto/history/HistoricVariableInstanceDto.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,120 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/variable-instance/get-variable-instance-query/index.html --> | ||
<#macro dto_macro docsUrl=""> | ||
<@lib.dto extends="VariableValueDto"> | ||
|
||
<@lib.property | ||
name = "id" | ||
type = "string" | ||
desc = "The id of the variable instance." | ||
/> | ||
|
||
<@lib.property | ||
name = "name" | ||
type = "string" | ||
desc = "The name of the variable instance." | ||
/> | ||
|
||
|
||
<@lib.property | ||
name = "processDefinitionKey" | ||
type = "string" | ||
desc = "The key of the process definition the variable instance belongs to." | ||
/> | ||
|
||
<@lib.property | ||
name = "processDefinitionId" | ||
type = "string" | ||
desc = "The id of the process definition the variable instance belongs to." | ||
/> | ||
|
||
<@lib.property | ||
name = "processInstanceId" | ||
type = "string" | ||
desc = "The process instance id the variable instance belongs to." | ||
/> | ||
|
||
<@lib.property | ||
name = "executionId" | ||
type = "string" | ||
desc = "The execution id the variable instance belongs to." | ||
/> | ||
|
||
<@lib.property | ||
name = "activityInstanceId" | ||
type = "string" | ||
desc = "The id of the activity instance in which the variable is valid." | ||
/> | ||
|
||
<@lib.property | ||
name = "caseDefinitionKey" | ||
type = "string" | ||
desc = "The key of the case definition the variable instance belongs to." | ||
/> | ||
|
||
<@lib.property | ||
name = "caseDefinitionId" | ||
type = "string" | ||
desc = "The id of the case definition the variable instance belongs to." | ||
/> | ||
|
||
<@lib.property | ||
name = "caseInstanceId" | ||
type = "string" | ||
desc = "The case instance id the variable instance belongs to." | ||
/> | ||
|
||
<@lib.property | ||
name = "caseExecutionId" | ||
type = "string" | ||
desc = "The case execution id the variable instance belongs to." | ||
/> | ||
|
||
<@lib.property | ||
name = "taskId" | ||
type = "string" | ||
desc = "The id of the task the variable instance belongs to." | ||
/> | ||
|
||
<@lib.property | ||
name = "tenantId" | ||
type = "string" | ||
desc = "The id of the tenant that this variable instance belongs to." | ||
/> | ||
|
||
<@lib.property | ||
name = "errorMessage" | ||
type = "string" | ||
desc = "An error message in case a Java Serialized Object could not be de-serialized." | ||
/> | ||
|
||
<@lib.property | ||
name = "state" | ||
type = "string" | ||
desc = "The current state of the variable. Can be 'CREATED' or 'DELETED'." | ||
/> | ||
|
||
<@lib.property | ||
name = "createTime" | ||
type = "string" | ||
format = "date-time" | ||
desc = "The time the variable was inserted. [Default format](${docsUrl}/reference/rest/overview/date-format/) `yyyy-MM-dd'T'HH:mm:ss.SSSZ`." | ||
/> | ||
|
||
<@lib.property | ||
name = "removalTime" | ||
type = "string" | ||
format = "date-time" | ||
desc = "The time after which the variable 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 variable." | ||
last = true | ||
/> | ||
|
||
</@lib.dto> | ||
</#macro> |
20 changes: 20 additions & 0 deletions
20
...lates/models/org/camunda/bpm/engine/rest/dto/history/HistoricVariableInstanceQueryDto.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,20 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/variable-instance/post-variable-instance-query/index.html --> | ||
<#macro dto_macro docsUrl=""> | ||
<@lib.dto desc = "A Historic Variable Instance instance query which defines a list of Historic Variable Instance instances"> | ||
|
||
<#assign requestMethod="POST"> | ||
<#include "/lib/commons/historic-variable-instance-query-params.ftl"> | ||
<@lib.properties params/> | ||
"sorting": { | ||
"type": "array", | ||
"description": "An array of criteria to sort the result by. Each element of the array is | ||
an object that specifies one ordering. The position in the array | ||
identifies the rank of an ordering, i.e., whether it is primary, secondary, | ||
etc. Sorting has no effect for `count` endpoints", | ||
"items": | ||
<#assign last = true> | ||
<#include "/lib/commons/sort-props.ftl"> | ||
} | ||
|
||
</@lib.dto> | ||
</#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
54 changes: 54 additions & 0 deletions
54
...rest/engine-rest-openapi/src/main/templates/paths/history/variable-instance/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,54 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/variable-instance/get-variable-instance-query-count/index.html --> | ||
<#macro endpoint_macro docsUrl=""> | ||
{ | ||
<@lib.endpointInfo | ||
id = "getHistoricVariableInstancesCount" | ||
tag = "Historic Variable Instance" | ||
summary = "Get Variable Instance Count" | ||
desc = "Queries for the number of historic variable instances that fulfill the given | ||
parameters. | ||
Takes the same parameters as the | ||
[Get Variable Instances](${docsUrl}/reference/rest/history/variable-instance/get-variable-instance-query/) | ||
method." | ||
/> | ||
|
||
"parameters" : [ | ||
|
||
<#assign last = true > | ||
<#assign requestMethod="GET"/> | ||
<#include "/lib/commons/historic-variable-instance-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/variable-instance/count?variableName=my_variable`", | ||
"description": "GET `/history/variable-instance/count?variableName=my_variable`", | ||
"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> |
56 changes: 56 additions & 0 deletions
56
...est/engine-rest-openapi/src/main/templates/paths/history/variable-instance/count/post.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,56 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/variable-instance/post-variable-instance-query-count/index.html --> | ||
<#macro endpoint_macro docsUrl=""> | ||
{ | ||
<@lib.endpointInfo | ||
id = "queryHistoricVariableInstancesCount" | ||
tag = "Historic Variable Instance" | ||
summary = "Get Variable Instance Count (POST)" | ||
desc = "Queries for historic variable instances that fulfill the given parameters. | ||
This method takes the same message body as the | ||
[Get Variable Instances (POST)](${docsUrl}/reference/rest/history/variable-instance/post-variable-instance-query/) | ||
method and therefore it is more powerful regarding variable values | ||
than the | ||
[Get Variable Instance Count](${docsUrl}/reference/rest/history/variable-instance/get-variable-instance-query-count/) | ||
method." | ||
/> | ||
|
||
<@lib.requestBody | ||
mediaType = "application/json" | ||
dto = "HistoricVariableInstanceQueryDto" | ||
examples = ['"example-1": { | ||
"summary": "POST `/history/variable-instance/count`", | ||
"value": { | ||
"variableName": "someVariable", | ||
"variableValue": 42 | ||
} | ||
}'] | ||
/> | ||
|
||
"responses": { | ||
|
||
<@lib.response | ||
code = "200" | ||
dto = "CountResultDto" | ||
desc = "Request successful." | ||
examples = ['"example-1": { | ||
"summary": "POST `/history/variable-instance/count`", | ||
"description": "POST `/history/variable-instance/count`", | ||
"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.