Queries for case executions that fulfill given parameters.Parameters may be static as well as dynamic runtime properties of case executions.The size of the result set can be retrieved by using the Get Case Execution Count method.

Method

GET /case-execution

Parameters

Query Parameters

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.
disabled Only include disabled case executions. Value may only be true, as false is the default behavior.
tenantIdIn Filter by a comma-separated list of tenant ids. A case execution must have one of the given tenant ids.
variables Only include case executions that have variables with certain values. Variable filtering expressions are comma-separated and are structured as follows: A valid parameter value has the form key_operator_value. key is the variable name, operator is the comparison operator to be used and value the variable value.Note: Values are always treated as String objects on server side. 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. key and value may not contain underscore or comma characters.
caseInstanceVariables Only include case executions that belong to a case instance with variables with certain values. Variable filtering expressions are comma-separated and are structured as follows: A valid parameter value has the form key_operator_value. key is the variable name, operator is the comparison operator to be used and value the variable value.Note: Values are always treated as String objects on server side. 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. key and value may not contain underscore or comma characters.
sortBy Sort the results lexicographically by a given criterion. Valid values are caseExecutionId, caseDefinitionKey, caseDefinitionId and tenantId. Must be used in conjunction with the sortOrder parameter.
sortOrder Sort the results in a given order. Values may be asc for ascending order or desc for descending order. Must be used in conjunction with the sortBy parameter.
firstResult Pagination of results. Specifies the index of the first result to return.
maxResults Pagination of results. Specifies the maximum number of results to return. Will return less results if there are no more results left.

Result

A JSON array of case execution objects.Each case execution object has the following properties:

Name Value Description
id String The id of the case execution.
caseInstanceId String The id of the case instance this case execution belongs to.
parentId String The id of the parent of this case execution belongs to.
caseDefinitionId String The id of the case definition this case execution belongs to.
activityId String The id of the activity this case execution belongs to.
activityName String The name of the activity this case execution belongs to.
activityType String The type of the activity this case execution belongs to.
activityDescription String The description of the activity this case execution belongs to.
required Boolean A flag indicating whether the case execution is required or not.
repeatable Boolean A flag indicating whether the case execution is repeatable or not.
repetition Boolean A flag indicating whether the case execution is a repetition or not.
active Boolean A flag indicating whether the case execution is active or not.
enabled Boolean A flag indicating whether the case execution is enabled or not.
disabled Boolean A flag indicating whether the case execution is disabled or not.
tenantId String The tenant id of the case execution.

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 a sortOrder parameter is supplied, but no sortBy, or if an invalid operator for variable comparison is used. See the Introduction for the error response format.

Example

Request

GET /case-execution?variables=myVariable_eq_camunda,mySecondVariable_neq_aBadValue

Response

  1. [
  2. {
  3. "id" : "7340e4ed-63b2-11e6-973e-56847afe9799",
  4. "caseInstanceId" : "7340e4ed-63b2-11e6-973e-56847afe9799",
  5. "caseDefinitionId" : "underwriting:1:dde173eb-63b1-11e6-973e-56847afe9799",
  6. "activityId" : "_manual_underwriting",
  7. "activityName" : "Underwriting",
  8. "activityType" : "casePlanModel",
  9. "activityDescription" : null,
  10. "parentId" : null,
  11. "tenantId" : null,
  12. "required" : false,
  13. "enabled" : false,
  14. "active" : true,
  15. "disabled" : false
  16. },
  17. {
  18. "id" : "73413315-63b2-11e6-973e-56847afe9799",
  19. "caseInstanceId" : "7340e4ed-63b2-11e6-973e-56847afe9799",
  20. "caseDefinitionId" : "underwriting:1:dde173eb-63b1-11e6-973e-56847afe9799",
  21. "activityId" : "PI_humanTaskDecide",
  22. "activityName" : "decide on application",
  23. "activityType" : "humanTask",
  24. "activityDescription" : null,
  25. "parentId" : "7340e4ed-63b2-11e6-973e-56847afe9799",
  26. "tenantId" : null,
  27. "required" : false,
  28. "enabled" : false,
  29. "active" : true,
  30. "disabled" : false
  31. }
  32. ]

原文: https://docs.camunda.org/manual/7.9/reference/rest/case-execution/get-query/