Queries for historic details that fulfill the given parameters.This method is slightly more powerful than the Get Historic Details method because it allowssorting by multiple parameters.The size of the result set can be retrieved by using the Get Historic Detail Count method.

Method

POST /history/detail

Parameters

Query Parameters

|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.
|deserializeValues| Determines whether serializable variable values (typically variables that store custom Java objects) should be deserialized on server side (default true).
If set to true, a serializable variable will be deserialized on server side and transformed to JSON using Jackson's POJO/bean property introspection feature. Note that this requires the Java classes of the variable value to be on the REST API's classpath.

If set to false, a serializable variable will be returned in its serialized format. For example, a variable that is serialized as XML will be returned as a JSON string containing XML.

Note: While true is the default value for reasons of backward compatibility, we recommend setting this parameter to false when developing web applications that are independent of the Java process applications deployed to the engine.

Request

A JSON object with the following properties:

Name Description
processInstanceId Filter by process instance id.
processInstanceIdIn Only include historic details which belong to one of the passed process instance ids.
executionId Filter by execution id.
activityInstanceId Filter by activity instance id.
caseInstanceId Filter by case instance id.
caseExecutionId Filter by case execution id.
variableInstanceId Filter by variable instance id.
variableTypeIn Only include historic details where the variable updates belong to one of the passed and comma-separated variable types. A list of all supported variable types can be found here. Note: All non-primitive variables are assoziated with the type "serializable".
tenantIdIn Filter by a comma-separated list of tenant ids.
userOperationId Filter by a user operation id
formFields Only include HistoricFormFields. Value may only be true, as false is the default behavior.
variableUpdates Only include HistoricVariableUpdates. Value may only be true, as false is the default behavior.
excludeTaskDetails Excludes all task-related HistoricDetails, so only items which have no task id set will be selected. When this parameter is used together with taskId, this call is ignored and task details are not excluded. Value may only be true, as false is the default behavior.
occurredBefore Restrict to historic details that occured before the given date (including the 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.
occurredAfter Restrict to historic details that occured after the given date (including the 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.
sorting A JSON array of criteria to sort the result by. Each element of the array is a JSON object that specifies one ordering. The position in the array identifies the rank of an ordering, i.e., whether it is primary, secondary, etc. The ordering objects have the following properties:

sortByMandatory. Sort the results lexicographically by a given criterion. Valid values are processInstanceId, variableName, variableType, variableRevision, formPropertyId, time, occurrence and tenantId.
sortOrderMandatory. Sort the results in a given order. Values may be asc for ascending order or desc for descending order.

|sortBy|Mandatory. Sort the results lexicographically by a given criterion. Valid values are processInstanceId, variableName, variableType, variableRevision, formPropertyId, time, occurrence and tenantId.|sortOrder|Mandatory. Sort the results in a given order. Values may be asc for ascending order or desc for descending order.
|sortBy|Mandatory. Sort the results lexicographically by a given criterion. Valid values are processInstanceId, variableName, variableType, variableRevision, formPropertyId, time, occurrence and tenantId.
|sortOrder|Mandatory. Sort the results in a given order. Values may be asc for ascending order or desc for descending order.

Result

A JSON array of historic detail objects.Each historic detail object has the following properties:

Name Value Description
id String The id of the historic detail.
type String The type of the historic detail. Either formField for a submitted form field value or variableUpdate for variable updates.
processDefinitionKey String The key of the process definition that this historic detail belongs to.
processDefinitionId String The id of the process definition that this historic detail belongs to.
processInstanceId String The id of the process instance the historic detail belongs to.
activityInstanceId String The id of the execution the historic detail belongs to.
executionId String The id of the execution the historic detail belongs to.
caseDefinitionKey String The key of the case definition that this historic detail belongs to.
caseDefinitionId String The id of the case definition that this historic detail belongs to.
caseInstanceId String The id of the case instance the historic detail belongs to.
caseExecutionId String The id of the case execution the historic detail belongs to.
taskId String The id of the task the historic detail belongs to.
tenantId String The id of the tenant that this historic detail belongs to.
userOperationId String The id of user operation which links historic detail with user operation log entries.
time String The time when this historic detail occurred, default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ.

Depending on the type of the historic detail it contains further properties. In case of an HistoricVariableUpdate the following properties are also provided:

Name Value Description
variableName String The name of the variable which has been updated.
variableInstanceId String The id of the associated variable instance.
variableType String The value type of the variable.
Name Value Description
——-
value String/Number/Boolean/Object

NameValueDescription
valueString / Number / Boolean / Object The variable's value. Value differs depending on the variable's type and on the deserializeValues parameter.
typeStringThe value type of the variable.
valueInfoObject 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.


|value|String / Number / Boolean / Object| The variable's value. Value differs depending on the variable's type and on the deserializeValues parameter.|type|String|The value type of the variable.|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.
    |Name|Value|Description
    |——-
    |value|String / Number / Boolean / Object| The variable's value. Value differs depending on the variable's type and on the deserializeValues parameter.
    |type|String|The value type of the variable.
    |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.
    |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.
    |revision|number|The revision of the historic variable update.
    |errorMessage|String|An error message in case a Java Serialized Object could not be de-serialized.
  • In case of an HistoricFormField the following properties are also provided:

    Name Value Description
    fieldId String The id of the form field.
    fieldValue String/Number/Boolean/Object The submitted value.

    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

    POST /history/detail?firstResult=1&maxResults=10

    Response Body:

    1. {
    2. "processInstanceId": "3cd597b7-001a-11e7-8c6b-34f39ab71d4e",
    3. "occurredAfter": "2018-01-29T10:15:45.000+0100",
    4. "sorting": [
    5. {
    6. "sortBy": "processInstanceId",
    7. "sortOrder": "asc"
    8. }
    9. ]
    10. }

    Response

    1. [
    2. {
    3. "type": "variableUpdate",
    4. "id": "3cd79390-001a-11e7-8c6b-34f39ab71d4e",
    5. "processDefinitionKey": "invoice",
    6. "processDefinitionId": "invoice:1:3c59899b-001a-11e7-8c6b-34f39ab71d4e",
    7. "processInstanceId": "3cd597b7-001a-11e7-8c6b-34f39ab71d4e",
    8. "activityInstanceId": "StartEvent_1:3cd7456e-001a-11e7-8c6b-34f39ab71d4e",
    9. "executionId": "3cd597b7-001a-11e7-8c6b-34f39ab71d4e",
    10. "caseDefinitionKey": null,
    11. "caseDefinitionId": null,
    12. "caseInstanceId": null,
    13. "caseExecutionId": null,
    14. "taskId": null,
    15. "tenantId": null,
    16. "userOperationId": "3cd76c7f-001a-11e7-8c6b-34f39ab71d4e",
    17. "time": "2017-03-03T15:03:54.000+0200",
    18. "variableName": "amount",
    19. "variableInstanceId": "3cd65b08-001a-11e7-8c6b-34f39ab71d4e",
    20. "variableType": "Double",
    21. "value": 30.0,
    22. "valueInfo": {},
    23. "revision": 0,
    24. "errorMessage": null
    25. },
    26. {
    27. "type": "variableUpdate",
    28. "id": "3cd79392-001a-11e7-8c6b-34f39ab71d4e",
    29. "processDefinitionKey": "invoice",
    30. "processDefinitionId": "invoice:1:3c59899b-001a-11e7-8c6b-34f39ab71d4e",
    31. "processInstanceId": "3cd597b7-001a-11e7-8c6b-34f39ab71d4e",
    32. "activityInstanceId": "StartEvent_1:3cd7456e-001a-11e7-8c6b-34f39ab71d4e",
    33. "executionId": "3cd597b7-001a-11e7-8c6b-34f39ab71d4e",
    34. "caseDefinitionKey": null,
    35. "caseDefinitionId": null,
    36. "caseInstanceId": null,
    37. "caseExecutionId": null,
    38. "taskId": null,
    39. "tenantId": null,
    40. "userOperationId": "3cd76c7f-001a-11e7-8c6b-34f39ab71d4e",
    41. "time": "2017-03-03T15:03:54.000+0200",
    42. "variableName": "invoiceDocument",
    43. "variableInstanceId": "3cd65b0a-001a-11e7-8c6b-34f39ab71d4e",
    44. "variableType": "File",
    45. "value": null,
    46. "valueInfo": {
    47. "mimeType": "application/pdf",
    48. "filename": "invoice.pdf"
    49. },
    50. "revision": 0,
    51. "errorMessage": null
    52. }
    53. ]

    原文: https://docs.camunda.org/manual/7.9/reference/rest/history/detail/post-detail-query/