Executes the saved query of the filter by id and returns the count. This method is slightly morepowerful then the Get Execute Filter Count method because it allows to extendthe saved query of the filter.
Security Consideration
The request body of this method takes a JSON-serialized query. Some query types (e.g., task queries) allow to specify EL expressions in their parameters and may therefore be abused for remote code execution. See the section on security considerations for custom code in the user guide for details.
Method
POST /filter/{id}/count
Parameters
Path Parameters
Name | Description |
---|---|
id | The id of the filter to execute. |
Request Body
A JSON object which corresponds to the type of the saved query of the filter, i.e., if theresource type of the filter is Task
the body should form a valid task query corresponding tothe Task resource.
Result
A JSON object with a single count property.
Name | Value | Description |
---|---|---|
count | Number | The number of filters that fulfill the query criteria. |
Response Codes
Code | Media type | Description |
---|---|---|
200 | application/json | Request successful. |
400 | application/json | The extending query was invalid. See the Introduction for the error response format. |
403 | application/json | The authenticated user is unauthorized to read this filter. See the Introduction for the error response format. |
404 | application/json | Filter with given id does not exist. See the Introduction for the error response format. |
Example
Request
POST filter/aTaskFilterId/singleResult
Request Body:
Note: The examples show a task filter. So the request body corresponds to a task query. For other resource types the request body will differ.
{
"assignee": "jonny1",
"taskDefinitionKey": "aTaskKey"
}
Response
Status 200.
{
"count": 1
}
原文: https://docs.camunda.org/manual/7.9/reference/rest/filter/post-execute-count/