Queries for historic decision instances that fulfill the given parameters. Thesize of the result set can be retrieved by using the Get Historic Decision Instance Count method.

Method

GET /history/decision-instance

Parameters

Query Parameters

Name Description
decisionInstanceId Filter by decision instance id.
decisionInstanceIdIn Filter by decision instance ids. Must be a comma-separated list of decision instance ids.
decisionDefinitionId Filter by the decision definition the instances belongs to.
decisionDefinitionIdIn Filter by the decision definitions the instances belongs to. Must be a comma-separated list of decision definition ids.
decisionDefinitionKey Filter by the key of the decision definition the instances belongs to.
decisionDefinitionKeyIn Filter by the keys of the decision definition the instances belongs to. Must be a comma-separated list of decision definition keys.
decisionDefinitionName Filter by the name of the decision definition the instances belongs to.
decisionDefinitionNameLike Filter by the name of the decision definition the instances belongs to, that the parameter is a substring of.
processDefinitionId Filter by the process definition the instances belongs to.
processDefinitionKey Filter by the key of the process definition the instances belongs to.
processInstanceId Filter by the process instance the instances belongs to.
caseDefinitionId Filter by the case definition the instances belongs to.
caseDefinitionKey Filter by the key of the case definition the instances belongs to.
caseInstanceId Filter by the case instance the instances belongs to.
activityIdIn Filter by the activity ids the instances belongs to. Must be a comma-separated list of acitvity ids.
activityInstanceIdIn Filter by the activity instance ids the instances belongs to. Must be a comma-separated list of acitvity instance ids.
tenantIdIn Filter by a comma-separated list of tenant ids. A historic decision instance must have one of the given tenant ids.
evaluatedBefore Restrict to instances that were evaluated before the given date. By default*, the date must have the format yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g., 2013-01-23T14:42:45.000+0200.
evaluatedAfter Restrict to instances that were evaluated after the given date. By default*, the date must have the format yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g., 2013-01-23T14:42:45.000+0200.
userId Restrict to instances that were evaluated by the given user.
includeInputs Include input values in the result. Value may only be true, as false is the default behavior.
includeOutputs Include output values in the result. Value may only be true, as false is the default behavior.
disableBinaryFetching Disables fetching of byte array input and output values. Value may only be true, as false is the default behavior.
disableCustomObjectDeserialization Disables deserialization of input and output values that are custom objects. Value may only be true, as false is the default behavior.
rootDecisionInstanceId Restrict to instances that have a given root decision instance id. This also includes the decision instance with the given id.
rootDecisionInstancesOnly Restrict to instances those are the root decision instance of an evaluation. Value may only be true, as false is the default behavior.
decisionRequirementsDefinitionId Filter by the decision requirements definition the instances belongs to.
decisionRequirementsDefinitionKey Filter by the key of the decision requirements definition the instances belongs to.
sortBy Sort the results by a given criterion. Valid values are evaluationTime 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 historic decision instance objects.Each historic decision instance object has the following properties:

Name Value Description
id String The id of the decision instance.
decisionDefinitionId String The id of the decision definition that this decision instance belongs to.
decisionDefinitionKey String The key of the decision definition that this decision instance belongs to.
decisionDefinitionName String The name of the decision definition that this decision instance belongs to.
evaluationTime String The time the instance was evaluated. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ.
processDefinitionId String The id of the process definition that this decision instance belongs to.
processDefinitionKey String The key of the process definition that this decision instance belongs to.
processInstanceId String The id of the process instance that this decision instance belongs to.
caseDefinitionId String The id of the case definition that this decision instance belongs to.
caseDefinitionKey String The key of the case definition that this decision instance belongs to.
caseInstanceId String The id of the case instance that this decision instance belongs to.
activityId String The id of the activity that this decision instance belongs to.
activityInstanceId String The id of the activity instance that this decision instance belongs to.
tenantId String The tenant id of the historic decision instance.
userId String The id of the authenticated user that has evaluated this decision instance without a process or case instance.
inputs List of decision inputs The list of decision input values. Only exists if includeInputs was set to true in the query. For the decision input properties see below.
ouputs List of decision outputs The list of decision output values. Only exists if includeOutputs was set to true in the query. For the decision output properties see below.
collectResultValue Double The result of the collect aggregation of the decision result if used. null if no aggregation was used.
rootDecisionInstanceId String The decision instance id of the evaluated root decision. Can be null if this instance is the root decision instance of the evaluation.
decisionRequirementsDefinitionId String The id of the decision requirements definition that this decision instance belongs to.
decisionRequirementsDefinitionKey String The key of the decision requirements definition that this decision instance belongs to.

Decision Input Value

Name Value Description
id String The id of the decision input value.
decisionInstanceId String The id of the decision instance the input value belongs to.
clauseId String The id of the clause the input value belongs to.
clauseName String The name of the clause the input value belongs to.
errorMessage String An error message in case a Java Serialized Object could not be de-serialized.
type String The value type of the variable.
value String/Number/Boolean/Object The variable's value. Value differs depending on the variable's type and on the disableCustomObjectDeserialization parameter.
valueInfo Object A JSON object containing additional, value-type-dependent properties.

For variables of type Object, the following properties are returned:

  • objectTypeName: A string representation of the object's type name.
  • serializationDataFormat: The serialization format used to store the variable.

Decision Output Value

Name Value Description
id String The id of the decision output value.
decisionInstanceId String The id of the decision instance the output value belongs to.
clauseId String The id of the clause the output value belongs to.
clauseName String The name of the clause the output value belongs to.
ruleId String The id of the rule the output value belongs to.
ruleOrder Integer The order of the rule the output value belongs to.
errorMessage String An error message in case a Java Serialized Object could not be de-serialized.
variableName String The name of the output variable.
type String The value type of the variable.
value String/Number/Boolean/Object The variable's value. Value differs depending on the variable's type and on the disableCustomObjectDeserialization parameter.
valueInfo Object A JSON object containing additional, value-type-dependent properties.

For variables of type Object, the following properties are returned:

  • objectTypeName: A string representation of the object's type name.
  • serializationDataFormat: The serialization format used to store the variable.

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. See the Introduction for the error response format.

Example

Request

GET /history/decision-instance?includeInputs=true&includeOutputs=true

Response

  1. [
  2. {
  3. "activityId": "assignApprover",
  4. "activityInstanceId": "assignApprover:67e9de1e-579d-11e5-9848-f0def1e59da8",
  5. "collectResultValue": null,
  6. "decisionDefinitionId": "invoice-assign-approver:1:4c864d79-579d-11e5-9848-f0def1e59da8",
  7. "decisionDefinitionKey": "invoice-assign-approver",
  8. "decisionDefinitionName": "Assign Approver",
  9. "evaluationTime": "2015-09-10T11:22:06.000+0200",
  10. "id": "67ea2c3f-579d-11e5-9848-f0def1e59da8",
  11. "inputs": [
  12. {
  13. "clauseId": "clause1",
  14. "clauseName": "Invoice Amount",
  15. "decisionInstanceId": "67ea2c3f-579d-11e5-9848-f0def1e59da8",
  16. "errorMessage": null,
  17. "id": "67ea2c41-579d-11e5-9848-f0def1e59da8",
  18. "type": "Double",
  19. "value": 123.0,
  20. "valueInfo": {}
  21. },
  22. {
  23. "clauseId": "clause2",
  24. "clauseName": "Invoice Category",
  25. "decisionInstanceId": "67ea2c3f-579d-11e5-9848-f0def1e59da8",
  26. "errorMessage": null,
  27. "id": "67ea2c40-579d-11e5-9848-f0def1e59da8",
  28. "type": "String",
  29. "value": "Misc",
  30. "valueInfo": {}
  31. }
  32. ],
  33. "outputs": [
  34. {
  35. "clauseId": "clause3",
  36. "clauseName": "Approver Group",
  37. "decisionInstanceId": "67ea2c3f-579d-11e5-9848-f0def1e59da8",
  38. "errorMessage": null,
  39. "id": "67ea2c42-579d-11e5-9848-f0def1e59da8",
  40. "ruleId": "DecisionRule_1of5a87",
  41. "ruleOrder": 1,
  42. "type": "String",
  43. "value": "accounting",
  44. "valueInfo": {},
  45. "variableName": "result"
  46. }
  47. ],
  48. "processDefinitionId": "invoice:1:4c6e3197-579d-11e5-9848-f0def1e59da8",
  49. "processDefinitionKey": "invoice",
  50. "processInstanceId": "67e98fec-579d-11e5-9848-f0def1e59da8",
  51. "caseDefinitionId": null,
  52. "caseDefinitionKey": null,
  53. "caseInstanceId": null,
  54. "tenantId":null,
  55. "userId": null,
  56. "rootDecisionInstanceId": null,
  57. "decisionRequirementsDefinitionId": null,
  58. "decisionRequirementsDefinitionKey": null
  59. }
  60. ]

原文: https://docs.camunda.org/manual/7.9/reference/rest/history/decision-instance/get-decision-instance-query/