Get Case Execution Count (POST)
Queries for the number of case executions that fulfill the given parameters. This method takes the same message body as the Get Case Executions (POST) method and therefore it is slightly more powerful than the Get Case Execution Count method.
Method
POST /case-instance/count
Parameters
Request Body
A JSON object with the following properties:
Name | Description |
---|---|
caseExecutionId | Filter by a case execution id. |
caseInstanceId | Filter by a case instance id. |
businessKey | Filter by the business key of the case instances the case executions belong to. |
caseDefinitionId | Filter by the case definition the case executions run on. |
caseDefinitionKey | Filter by the key of the case definition the case executions run on. |
activityId | Filter by the id of the activity the case execution currently executes. |
required | Only include required case executions. Value may only be true , as false is the default behavior. |
repeatable | Only include repeatable case executions. Value may only be true , as false is the default behavior. |
repetition | Only include case executions which are repetitions. Value may only be true , as false is the default behavior. |
active | Only include active case executions. Value may only be true , as false is the default behavior. |
enabled | Only include enabled case executions. Value may only be true , as false is the default behavior. |
tenantIdIn | Filter by a list of tenant ids. A case execution must have one of the given tenant ids. Must be a JSON array of Strings. |
variables | A JSON array to only include case instances that have variables with certain values. The array consists of objects with the three properties name , operator and value .
name (String) is the variable name, operator (String) is the comparison operator to be used and value the variable value.value may be String , Number or Boolean .
Valid operator values are: eq - equal to; neq - not equal to; gt - greater than;
gteq - greater than or equal to; lt - lower than; lteq - lower than or equal to;
like . |
caseInstanceVariables | A JSON array to only include case executions that belong to a case instance with variables with certain values. The array consists of objects with the three properties name , operator and value .
name (String) is the variable name, operator (String) is the comparison operator to be used and value the variable value.value may be String , Number or Boolean .
Valid operator values are: eq - equal to; neq - not equal to; gt - greater than;
gteq - greater than or equal to; lt - lower than; lteq - lower than or equal to;
like . |
variableNamesIgnoreCase | Match all variable names provided in variables and caseInstanceVariables case-insensitively. If set to true variableName and variablename are treated as equal. |
variableValuesIgnoreCase | Match all variable values provided in variables and caseInstanceVariables case-insensitively. If set to true variableValue and variablevalue are treated as equal. |
Result
A JSON object that contains the count as the only property.
Name | Type | Description |
---|---|---|
count | Number | The number of matching case executions. |
Response Codes
Code | Media type | Description |
---|---|---|
200 | application/json | Request successful. |
400 | application/json | Returned if some of the query parameters are invalid, for example if an invalid operator for variable comparison is used. See the Introduction for the error response format. |
Example
Request
POST /case-execution/count
Request Body:
{
"variables":
[
{
"name" : "myVariable",
"operator" : "eq",
"value" : "camunda"
},
{
"name" : "mySecondVariable",
"operator" : "neq",
"value" : 124
}
],
"caseDefinitionId" : "aCaseDefinitionId"
}
Response
{
"count" : 1
}