Get Execution Count (POST)

Queries for the number of executions that fulfill given parameters. This method takes the same message body as the Get Executions (POST) method and therefore it is slightly more powerful than the Get Execution Count method.

Method

POST /execution/count

Parameters

Request Body

A JSON object with the following properties:

Name Description
businessKey Filter by the business key of the process instances the executions belong to.
processDefinitionId Filter by the process definition the executions run on.
processDefinitionKey Filter by the key of the process definition the executions run on.
processInstanceId Filter by the id of the process instance the execution belongs to.
activityId Filter by the id of the activity the execution currently executes.
signalEventSubscriptionName Select only those executions that expect a signal of the given name.
messageEventSubscriptionName Select only those executions that expect a message of the given name.
active Only include active executions. Value may only be true, as false is the default behavior.
suspended Only include suspended executions. Value may only be true, as false is the default behavior.
incidentId Filter by the incident id.
incidentType Filter by the incident type. See the User Guide for a list of incident types.
incidentMessage Filter by the incident message. Exact match.
incidentMessageLike Filter by the incident message that the parameter is a substring of.
tenantIdIn Filter by a list of tenant ids. An execution must have one of the given tenant ids. Must be a JSON array of Strings.
variables A JSON array to only include executions 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.
processVariables A JSON array to only include executions that belong to a process 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.
Note: Values are always treated as String objects on server side.

Valid operator values are: eq - equal to; neq - not equal to.
variableNamesIgnoreCase Match all variable names provided in variables and processVariables case-insensitively. If set to true variableName and variablename are treated as equal.
variableValuesIgnoreCase Match all variable values provided in variables and processVariables 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 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 /execution/count

Request Body:

{"variables":
    [{"name": "myVariable",
     "operator": "eq",
     "value": "camunda"
    },
    {"name": "mySecondVariable",
     "operator": "neq",
     "value": 124}],
"processDefinitionId":"aProcessDefinitionId"}

Response

{"count": 1}

On this Page: