返回介绍

15.8. History

发布于 2023-09-17 23:40:35 字数 45820 浏览 0 评论 0 收藏 0

15.8.1. Get a historic process instance

GET history/historic-process-instances/{processInstanceId}
Table 178. Get a historic process instance - Response codes
Response codeDescription
200Indicates that the historic process instances could be found.
404Indicates that the historic process instances could not be found.

Success response body:

{
  "data": [
  {
    "id" : "5",
    "businessKey" : "myKey",
    "processDefinitionId" : "oneTaskProcess%3A1%3A4",
    "processDefinitionUrl" : "http://localhost:8182/repository/process-definitions/oneTaskProcess%3A1%3A4",
    "startTime" : "2013-04-17T10:17:43.902+0000",
    "endTime" : "2013-04-18T14:06:32.715+0000",
    "durationInMillis" : 86400056,
    "startUserId" : "kermit",
    "startActivityId" : "startEvent",
    "endActivityId" : "endEvent",
    "deleteReason" : null,
    "superProcessInstanceId" : "3",
    "url" : "http://localhost:8182/history/historic-process-instances/5",
    "variables": null,
    "tenantId":null
  }
  ],
  "total": 1,
  "start": 0,
  "sort": "name",
  "order": "asc",
  "size": 1
}

15.8.2. List of historic process instances

GET history/historic-process-instances
Table 179. List of historic process instances - URL parameters
ParameterRequiredValueDescription
processInstanceIdNoStringAn id of the historic process instance.
processDefinitionKeyNoStringThe process definition key of the historic process instance.
processDefinitionIdNoStringThe process definition id of the historic process instance.
businessKeyNoStringThe business key of the historic process instance.
involvedUserNoStringAn involved user of the historic process instance.
finishedNoBooleanIndication if the historic process instance is finished.
superProcessInstanceIdNoStringAn optional parent process id of the historic process instance.
excludeSubprocessesNoBooleanReturn only historic process instances which aren’t sub processes.
finishedAfterNoDateReturn only historic process instances that were finished after this date.
finishedBeforeNoDateReturn only historic process instances that were finished before this date.
startedAfterNoDateReturn only historic process instances that were started after this date.
startedBeforeNoDateReturn only historic process instances that were started before this date.
startedByNoStringReturn only historic process instances that were started by this user.
includeProcessVariablesNoBooleanAn indication if the historic process instance variables should be returned as well.
tenantIdNoStringOnly return instances with the given tenantId.
tenantIdLikeNoStringOnly return instances with a tenantId like the given value.
withoutTenantIdNoBooleanIf true, only returns instances without a tenantId set. If false, the withoutTenantId parameter is ignored.
Table 180. List of historic process instances - Response codes
Response codeDescription
200Indicates that historic process instances could be queried.
400Indicates an parameter was passed in the wrong format. The status-message contains additional information.

Success response body:

{
  "data": [
  {
    "id" : "5",
    "businessKey" : "myKey",
    "processDefinitionId" : "oneTaskProcess%3A1%3A4",
    "processDefinitionUrl" : "http://localhost:8182/repository/process-definitions/oneTaskProcess%3A1%3A4",
    "startTime" : "2013-04-17T10:17:43.902+0000",
    "endTime" : "2013-04-18T14:06:32.715+0000",
    "durationInMillis" : 86400056,
    "startUserId" : "kermit",
    "startActivityId" : "startEvent",
    "endActivityId" : "endEvent",
    "deleteReason" : null,
    "superProcessInstanceId" : "3",
    "url" : "http://localhost:8182/history/historic-process-instances/5",
    "variables": [
    {
      "name": "test",
      "variableScope": "local",
      "value": "myTest"
    }
    ],
    "tenantId":null
  }
  ],
  "total": 1,
  "start": 0,
  "sort": "name",
  "order": "asc",
  "size": 1
}

15.8.3. Query for historic process instances

POST query/historic-process-instances

Request body:

{
  "processDefinitionId" : "oneTaskProcess%3A1%3A4",


  "variables" : [
  {
    "name" : "myVariable",
    "value" : 1234,
    "operation" : "equals",
    "type" : "long"
  }
  ]
}

All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of historic process instances, but passed in as JSON-body arguments rather than URL-parameters to allow for more advanced querying and preventing errors with request-uri’s that are too long. On top of that, the query allows for filtering based on process variables. The variables property is a JSON-array containing objects with the format as described here.

Table 181. Query for historic process instances - Response codes
Response codeDescription
200Indicates request was successful and the tasks are returned
400Indicates an parameter was passed in the wrong format. The status-message contains additional information.

Success response body:

{
  "data": [
  {
    "id" : "5",
    "businessKey" : "myKey",
    "processDefinitionId" : "oneTaskProcess%3A1%3A4",
    "processDefinitionUrl" : "http://localhost:8182/repository/process-definitions/oneTaskProcess%3A1%3A4",
    "startTime" : "2013-04-17T10:17:43.902+0000",
    "endTime" : "2013-04-18T14:06:32.715+0000",
    "durationInMillis" : 86400056,
    "startUserId" : "kermit",
    "startActivityId" : "startEvent",
    "endActivityId" : "endEvent",
    "deleteReason" : null,
    "superProcessInstanceId" : "3",
    "url" : "http://localhost:8182/history/historic-process-instances/5",
    "variables": [
    {
      "name": "test",
      "variableScope": "local",
      "value": "myTest"
    }
    ],
    "tenantId":null
  }
  ],
  "total": 1,
  "start": 0,
  "sort": "name",
  "order": "asc",
  "size": 1
}

15.8.4. Delete a historic process instance

DELETE history/historic-process-instances/{processInstanceId}
Table 182. Response codes
Response codeDescription
200Indicates that the historic process instance was deleted.
404Indicates that the historic process instance could not be found.

15.8.5. Get the identity links of a historic process instance

GET history/historic-process-instance/{processInstanceId}/identitylinks
Table 183. Response codes
Response codeDescription
200Indicates request was successful and the identity links are returned
404Indicates the process instance could not be found.

Success response body:

[
 {
  "type" : "participant",
  "userId" : "kermit",
  "groupId" : null,
  "taskId" : null,
  "taskUrl" : null,
  "processInstanceId" : "5",
  "processInstanceUrl" : "http://localhost:8182/history/historic-process-instances/5"
 }
]

15.8.6. Get the binary data for a historic process instance variable

GET history/historic-process-instances/{processInstanceId}/variables/{variableName}/data
Table 184. Get the binary data for a historic process instance variable - Response codes
Response codeDescription
200Indicates the process instance was found and the requested variable data is returned.
404Indicates the requested process instance was not found or the process instance doesn’t have a variable with the given name or the variable doesn’t have a binary stream available. Status message provides additional information.

Success response body:

The response body contains the binary value of the variable. When the variable is of type binary, the content-type of the response is set to application/octet-stream, regardless of the content of the variable or the request accept-type header. In case of serializable, application/x-java-serialized-object is used as content-type.

15.8.7. Create a new comment on a historic process instance

POST history/historic-process-instances/{processInstanceId}/comments
Table 185. Create a new comment on a historic process instance - URL parameters
ParameterRequiredValueDescription
processInstanceIdYesStringThe id of the process instance to create the comment for.

Request body:

{
  "message" : "This is a comment.",
  "saveProcessInstanceId" : true
}

Parameter saveProcessInstanceId is optional, if true save process instance id of task with comment.

Success response body:

{
  "id" : "123",
  "taskUrl" : "http://localhost:8081/flowable-rest/service/runtime/tasks/101/comments/123",
  "processInstanceUrl" : "http://localhost:8081/flowable-rest/service/history/historic-process-instances/100/comments/123",
  "message" : "This is a comment on the task.",
  "author" : "kermit",
  "time" : "2014-07-13T13:13:52.232+08:00",
  "taskId" : "101",
  "processInstanceId" : "100"
}
Table 186. Create a new comment on a historic process instance - Response codes
Response codeDescription
201Indicates the comment was created and the result is returned.
400Indicates the comment is missing from the request.
404Indicates the requested historic process instance was not found.

15.8.8. Get all comments on a historic process instance

GET history/historic-process-instances/{processInstanceId}/comments
Table 187. Get all comments on a process instance - URL parameters
ParameterRequiredValueDescription
processInstanceIdYesStringThe id of the process instance to get the comments for.

Success response body:

[
  {
  "id" : "123",
  "processInstanceUrl" : "http://localhost:8081/flowable-rest/service/history/historic-process-instances/100/comments/123",
  "message" : "This is a comment on the task.",
  "author" : "kermit",
  "time" : "2014-07-13T13:13:52.232+08:00",
  "processInstanceId" : "100"
  },
  {
  "id" : "456",
  "processInstanceUrl" : "http://localhost:8081/flowable-rest/service/history/historic-process-instances/100/comments/456",
  "message" : "This is another comment.",
  "author" : "gonzo",
  "time" : "2014-07-14T15:16:52.232+08:00",
  "processInstanceId" : "100"
  }
]
Table 188. Get all comments on a process instance - Response codes
Response codeDescription
200Indicates the process instance was found and the comments are returned.
404Indicates the requested task was not found.

15.8.9. Get a comment on a historic process instance

GET history/historic-process-instances/{processInstanceId}/comments/{commentId}
Table 189. Get a comment on a historic process instance - URL parameters
ParameterRequiredValueDescription
processInstanceIdYesStringThe id of the historic process instance to get the comment for.
commentIdYesStringThe id of the comment.

Success response body:

{
  "id" : "123",
  "processInstanceUrl" : "http://localhost:8081/flowable-rest/service/history/historic-process-instances/100/comments/456",
  "message" : "This is another comment.",
  "author" : "gonzo",
  "time" : "2014-07-14T15:16:52.232+08:00",
  "processInstanceId" : "100"
}
Table 190. Get a comment on a historic process instance - Response codes
Response codeDescription
200Indicates the historic process instance and comment were found and the comment is returned.
404Indicates the requested historic process instance was not found or the historic process instance doesn’t have a comment with the given ID.

15.8.10. Delete a comment on a historic process instance

DELETE history/historic-process-instances/{processInstanceId}/comments/{commentId}
Table 191. Delete a comment on a historic process instance - URL parameters
ParameterRequiredValueDescription
processInstanceIdYesStringThe id of the historic process instance to delete the comment for.
commentIdYesStringThe id of the comment.
Table 192. Delete a comment on a historic process instance - Response codes
Response codeDescription
204Indicates the historic process instance and comment were found and the comment is deleted. Response body is left empty intentionally.
404Indicates the requested task was not found or the historic process instance doesn’t have a comment with the given ID.

15.8.11. Get a single historic task instance

GET history/historic-task-instances/{taskId}
Table 193. Get a single historic task instance - Response codes
Response codeDescription
200Indicates that the historic task instances could be found.
404Indicates that the historic task instances could not be found.

Success response body:

{
  "id" : "5",
  "processDefinitionId" : "oneTaskProcess%3A1%3A4",
  "processDefinitionUrl" : "http://localhost:8182/repository/process-definitions/oneTaskProcess%3A1%3A4",
  "processInstanceId" : "3",
  "processInstanceUrl" : "http://localhost:8182/history/historic-process-instances/3",
  "executionId" : "4",
  "name" : "My task name",
  "description" : "My task description",
  "deleteReason" : null,
  "owner" : "kermit",
  "assignee" : "fozzie",
  "startTime" : "2013-04-17T10:17:43.902+0000",
  "endTime" : "2013-04-18T14:06:32.715+0000",
  "durationInMillis" : 86400056,
  "workTimeInMillis" : 234890,
  "claimTime" : "2013-04-18T11:01:54.715+0000",
  "taskDefinitionKey" : "taskKey",
  "formKey" : null,
  "priority" : 50,
  "dueDate" : "2013-04-20T12:11:13.134+0000",
  "parentTaskId" : null,
  "url" : "http://localhost:8182/history/historic-task-instances/5",
  "variables": null,
  "tenantId":null
}

15.8.12. Get historic task instances

GET history/historic-task-instances
Table 194. Get historic task instances - URL parameters
ParameterRequiredValueDescription
taskIdNoStringAn id of the historic task instance.
processInstanceIdNoStringThe process instance id of the historic task instance.
processDefinitionKeyNoStringThe process definition key of the historic task instance.
processDefinitionKeyLikeNoStringThe process definition key of the historic task instance, which matches the given value.
processDefinitionIdNoStringThe process definition id of the historic task instance.
processDefinitionNameNoStringThe process definition name of the historic task instance.
processDefinitionNameLikeNoStringThe process definition name of the historic task instance, which matches the given value.
processBusinessKeyNoStringThe process instance business key of the historic task instance.
processBusinessKeyLikeNoStringThe process instance business key of the historic task instance that matches the given value.
executionIdNoStringThe execution id of the historic task instance.
taskDefinitionKeyNoStringThe task definition key for tasks part of a process
taskNameNoStringThe task name of the historic task instance.
taskNameLikeNoStringThe task name with like operator for the historic task instance.
taskDescriptionNoStringThe task description of the historic task instance.
taskDescriptionLikeNoStringThe task description with like operator for the historic task instance.
taskDefinitionKeyNoStringThe task identifier from the process definition for the historic task instance.
taskCategoryNoStringSelect tasks with the given category. Note that this is the task category, not the category of the process definition (namespace within the BPMN Xml).
taskDeleteReasonNoStringThe task delete reason of the historic task instance.
taskDeleteReasonLikeNoStringThe task delete reason with like operator for the historic task instance.
taskAssigneeNoStringThe assignee of the historic task instance.
taskAssigneeLikeNoStringThe assignee with like operator for the historic task instance.
taskOwnerNoStringThe owner of the historic task instance.
taskOwnerLikeNoStringThe owner with like operator for the historic task instance.
taskInvolvedUserNoStringAn involved user of the historic task instance.
taskPriorityNoStringThe priority of the historic task instance.
finishedNoBooleanIndication if the historic task instance is finished.
processFinishedNoBooleanIndication if the process instance of the historic task instance is finished.
parentTaskIdNoStringAn optional parent task id of the historic task instance.
dueDateNoDateReturn only historic task instances that have a due date equal this date.
dueDateAfterNoDateReturn only historic task instances that have a due date after this date.
dueDateBeforeNoDateReturn only historic task instances that have a due date before this date.
withoutDueDateNoBooleanReturn only historic task instances that have no due-date. When false is provided as value, this parameter is ignored.
taskCompletedOnNoDateReturn only historic task instances that have been completed on this date.
taskCompletedAfterNoDateReturn only historic task instances that have been completed after this date.
taskCompletedBeforeNoDateReturn only historic task instances that have been completed before this date.
taskCreatedOnNoDateReturn only historic task instances that were created on this date.
taskCreatedBeforeNoDateReturn only historic task instances that were created before this date.
taskCreatedAfterNoDateReturn only historic task instances that were created after this date.
includeTaskLocalVariablesNoBooleanAn indication if the historic task instance local variables should be returned as well.
includeProcessVariablesNoBooleanAn indication if the historic task instance global variables should be returned as well.
tenantIdNoStringOnly return historic task instances with the given tenantId.
tenantIdLikeNoStringOnly return historic task instances with a tenantId like the given value.
withoutTenantIdNoBooleanIf true, only returns historic task instances without a tenantId set. If false, the withoutTenantId parameter is ignored.
Table 195. Get historic task instances - Response codes
Response codeDescription
200Indicates that historic process instances could be queried.
400Indicates an parameter was passed in the wrong format. The status-message contains additional information.

Success response body:

{
  "data": [
  {
    "id" : "5",
    "processDefinitionId" : "oneTaskProcess%3A1%3A4",
    "processDefinitionUrl" : "http://localhost:8182/repository/process-definitions/oneTaskProcess%3A1%3A4",
    "processInstanceId" : "3",
    "processInstanceUrl" : "http://localhost:8182/history/historic-process-instances/3",
    "executionId" : "4",
    "name" : "My task name",
    "description" : "My task description",
    "deleteReason" : null,
    "owner" : "kermit",
    "assignee" : "fozzie",
    "startTime" : "2013-04-17T10:17:43.902+0000",
    "endTime" : "2013-04-18T14:06:32.715+0000",
    "durationInMillis" : 86400056,
    "workTimeInMillis" : 234890,
    "claimTime" : "2013-04-18T11:01:54.715+0000",
    "taskDefinitionKey" : "taskKey",
    "formKey" : null,
    "priority" : 50,
    "dueDate" : "2013-04-20T12:11:13.134+0000",
    "parentTaskId" : null,
    "url" : "http://localhost:8182/history/historic-task-instances/5",
    "taskVariables": [
    {
      "name": "test",
      "variableScope": "local",
      "value": "myTest"
    }
    ],
    "processVariables": [
    {
      "name": "processTest",
      "variableScope": "global",
      "value": "myProcessTest"
    }
    ],
    "tenantId":null
  }
  ],
  "total": 1,
  "start": 0,
  "sort": "name",
  "order": "asc",
  "size": 1
}

15.8.13. Query for historic task instances

POST query/historic-task-instances

Query for historic task instances - Request body:

{
  "processDefinitionId" : "oneTaskProcess%3A1%3A4",
  ...

  "variables" : [
  {
    "name" : "myVariable",
    "value" : 1234,
    "operation" : "equals",
    "type" : "long"
  }
  ]
}

All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of historic task instances, but passed in as JSON-body arguments rather than URL-parameters to allow for more advanced querying and preventing errors with request-uri’s that are too long. On top of that, the query allows for filtering based on process variables. The taskVariables and processVariables properties are JSON-arrays containing objects with the format as described here.

Table 196. Query for historic task instances - Response codes
Response codeDescription
200Indicates request was successful and the tasks are returned
400Indicates an parameter was passed in the wrong format. The status-message contains additional information.

Success response body:

{
  "data": [
  {
    "id" : "5",
    "processDefinitionId" : "oneTaskProcess%3A1%3A4",
    "processDefinitionUrl" : "http://localhost:8182/repository/process-definitions/oneTaskProcess%3A1%3A4",
    "processInstanceId" : "3",
    "processInstanceUrl" : "http://localhost:8182/history/historic-process-instances/3",
    "executionId" : "4",
    "name" : "My task name",
    "description" : "My task description",
    "deleteReason" : null,
    "owner" : "kermit",
    "assignee" : "fozzie",
    "startTime" : "2013-04-17T10:17:43.902+0000",
    "endTime" : "2013-04-18T14:06:32.715+0000",
    "durationInMillis" : 86400056,
    "workTimeInMillis" : 234890,
    "claimTime" : "2013-04-18T11:01:54.715+0000",
    "taskDefinitionKey" : "taskKey",
    "formKey" : null,
    "priority" : 50,
    "dueDate" : "2013-04-20T12:11:13.134+0000",
    "parentTaskId" : null,
    "url" : "http://localhost:8182/history/historic-task-instances/5",
    "taskVariables": [
    {
      "name": "test",
      "variableScope": "local",
      "value": "myTest"
    }
    ],
    "processVariables": [
    {
      "name": "processTest",
      "variableScope": "global",
      "value": "myProcessTest"
    }
    ],
    "tenantId":null
  }
  ],
  "total": 1,
  "start": 0,
  "sort": "name",
  "order": "asc",
  "size": 1
}

15.8.14. Delete a historic task instance

DELETE history/historic-task-instances/{taskId}
Table 197. Response codes
Response codeDescription
200Indicates that the historic task instance was deleted.
404Indicates that the historic task instance could not be found.

15.8.15. Get the identity links of a historic task instance

GET history/historic-task-instance/{taskId}/identitylinks
Table 198. Response codes
Response codeDescription
200Indicates request was successful and the identity links are returned
404Indicates the task instance could not be found.

Success response body:

[
 {
  "type" : "assignee",
  "userId" : "kermit",
  "groupId" : null,
  "taskId" : "6",
  "taskUrl" : "http://localhost:8182/history/historic-task-instances/5",
  "processInstanceId" : null,
  "processInstanceUrl" : null
 }
]

15.8.16. Get the binary data for a historic task instance variable

GET history/historic-task-instances/{taskId}/variables/{variableName}/data
Table 199. Get the binary data for a historic task instance variable - Response codes
Response codeDescription
200Indicates the task instance was found and the requested variable data is returned.
404Indicates the requested task instance was not found or the process instance doesn’t have a variable with the given name or the variable doesn’t have a binary stream available. Status message provides additional information.

Success response body:

The response body contains the binary value of the variable. When the variable is of type binary, the content-type of the response is set to application/octet-stream, regardless of the content of the variable or the request accept-type header. In case of serializable, application/x-java-serialized-object is used as content-type.

15.8.17. Get historic activity instances

GET history/historic-activity-instances
Table 200. Get historic activity instances - URL parameters
ParameterRequiredValueDescription
activityIdNoStringAn id of the activity instance.
activityInstanceIdNoStringAn id of the historic activity instance.
activityNameNoStringThe name of the historic activity instance.
activityTypeNoStringThe element type of the historic activity instance.
executionIdNoStringThe execution id of the historic activity instance.
finishedNoBooleanIndication if the historic activity instance is finished.
taskAssigneeNoStringThe assignee of the historic activity instance.
processInstanceIdNoStringThe process instance id of the historic activity instance.
processDefinitionIdNoStringThe process definition id of the historic activity instance.
tenantIdNoStringOnly return instances with the given tenantId.
tenantIdLikeNoStringOnly return instances with a tenantId like the given value.
withoutTenantIdNoBooleanIf true, only returns instances without a tenantId set. If false, the withoutTenantId parameter is ignored.
Table 201. Get historic activity instances - Response codes
Response codeDescription
200Indicates that historic activity instances could be queried.
400Indicates an parameter was passed in the wrong format. The status-message contains additional information.

Success response body:

{
  "data": [
  {
    "id" : "5",
    "activityId" : "4",
    "activityName" : "My user task",
    "activityType" : "userTask",
    "processDefinitionId" : "oneTaskProcess%3A1%3A4",
    "processDefinitionUrl" : "http://localhost:8182/repository/process-definitions/oneTaskProcess%3A1%3A4",
    "processInstanceId" : "3",
    "processInstanceUrl" : "http://localhost:8182/history/historic-process-instances/3",
    "executionId" : "4",
    "taskId" : "4",
    "calledProcessInstanceId" : null,
    "assignee" : "fozzie",
    "startTime" : "2013-04-17T10:17:43.902+0000",
    "endTime" : "2013-04-18T14:06:32.715+0000",
    "durationInMillis" : 86400056,
    "tenantId":null
  }
  ],
  "total": 1,
  "start": 0,
  "sort": "name",
  "order": "asc",
  "size": 1
}

15.8.18. Query for historic activity instances

POST query/historic-activity-instances

Request body:

{
  "processDefinitionId" : "oneTaskProcess%3A1%3A4"
}

All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of historic task instances, but passed in as JSON-body arguments rather than URL-parameters to allow for more advanced querying and preventing errors with request-uri’s that are too long.

Table 202. Query for historic activity instances - Response codes
Response codeDescription
200Indicates request was successful and the activities are returned
400Indicates an parameter was passed in the wrong format. The status-message contains additional information.

Success response body:

{
  "data": [
  {
    "id" : "5",
    "activityId" : "4",
    "activityName" : "My user task",
    "activityType" : "userTask",
    "processDefinitionId" : "oneTaskProcess%3A1%3A4",
    "processDefinitionUrl" : "http://localhost:8182/repository/process-definitions/oneTaskProcess%3A1%3A4",
    "processInstanceId" : "3",
    "processInstanceUrl" : "http://localhost:8182/history/historic-process-instances/3",
    "executionId" : "4",
    "taskId" : "4",
    "calledProcessInstanceId" : null,
    "assignee" : "fozzie",
    "startTime" : "2013-04-17T10:17:43.902+0000",
    "endTime" : "2013-04-18T14:06:32.715+0000",
    "durationInMillis" : 86400056,
    "tenantId":null
  }
  ],
  "total": 1,
  "start": 0,
  "sort": "name",
  "order": "asc",
  "size": 1
}

15.8.19. List of historic variable instances

GET history/historic-variable-instances
Table 203. List of historic variable instances - URL parameters
ParameterRequiredValueDescription
processInstanceIdNoStringThe process instance id of the historic variable instance.
taskIdNoStringThe task id of the historic variable instance.
excludeTaskVariablesNoBooleanIndication to exclude the task variables from the result.
variableNameNoStringThe variable name of the historic variable instance.
variableNameLikeNoStringThe variable name using the like operator for the historic variable instance.
Table 204. List of historic variable instances - Response codes
Response codeDescription
200Indicates that historic variable instances could be queried.
400Indicates an parameter was passed in the wrong format. The status-message contains additional information.

Success response body:

{
  "data": [
  {
    "id" : "14",
    "processInstanceId" : "5",
    "processInstanceUrl" : "http://localhost:8182/history/historic-process-instances/5",
    "taskId" : "6",
    "variable" : {
    "name" : "myVariable",
    "variableScope", "global",
    "value" : "test"
    }
  }
  ],
  "total": 1,
  "start": 0,
  "sort": "name",
  "order": "asc",
  "size": 1
}

15.8.20. Query for historic variable instances

POST query/historic-variable-instances

Request body:

{
  "processDefinitionId" : "oneTaskProcess%3A1%3A4",
  ...

  "variables" : [
  {
    "name" : "myVariable",
    "value" : 1234,
    "operation" : "equals",
    "type" : "long"
  }
  ]
}

All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of historic process instances, but passed in as JSON-body arguments rather than URL-parameters to allow for more advanced querying and preventing errors with request-uri’s that are too long. On top of that, the query allows for filtering based on process variables. The variables property is a JSON-array containing objects with the format as described here.

Table 205. Query for historic variable instances - Response codes
Response codeDescription
200Indicates request was successful and the tasks are returned
400Indicates an parameter was passed in the wrong format. The status-message contains additional information.

Success response body:

{
  "data": [
  {
    "id" : "14",
    "processInstanceId" : "5",
    "processInstanceUrl" : "http://localhost:8182/history/historic-process-instances/5",
    "taskId" : "6",
    "variable" : {
    "name" : "myVariable",
    "variableScope", "global",
    "value" : "test"
    }
  }
  ],
  "total": 1,
  "start": 0,
  "sort": "name",
  "order": "asc",
  "size": 1
}

====Get the binary data for a historic task instance variable

GET history/historic-variable-instances/{varInstanceId}/data
Table 206. Get the binary data for a historic task instance variable - Response codes
Response codeDescription
200Indicates the variable instance was found and the requested variable data is returned.
404Indicates the requested variable instance was not found or the variable instance doesn’t have a variable with the given name or the variable doesn’t have a binary stream available. Status message provides additional information.

Success response body:

The response body contains the binary value of the variable. When the variable is of type binary, the content-type of the response is set to application/octet-stream, regardless of the content of the variable or the request accept-type header. In case of serializable, application/x-java-serialized-object is used as content-type.

15.8.21. Get historic detail

GET history/historic-detail
Table 207. Get historic detail - URL parameters
ParameterRequiredValueDescription
idNoStringThe id of the historic detail.
processInstanceIdNoStringThe process instance id of the historic detail.
executionIdNoStringThe execution id of the historic detail.
activityInstanceIdNoStringThe activity instance id of the historic detail.
taskIdNoStringThe task id of the historic detail.
selectOnlyFormPropertiesNoBooleanIndication to only return form properties in the result.
selectOnlyVariableUpdatesNoBooleanIndication to only return variable updates in the result.
Table 208. Get historic detail - Response codes
Response codeDescription
200Indicates that historic detail could be queried.
400Indicates an parameter was passed in the wrong format. The status-message contains additional information.

Success response body:

{
  "data": [
  {
    "id" : "26",
    "processInstanceId" : "5",
    "processInstanceUrl" : "http://localhost:8182/history/historic-process-instances/5",
    "executionId" : "6",
    "activityInstanceId", "10",
    "taskId" : "6",
    "taskUrl" : "http://localhost:8182/history/historic-task-instances/6",
    "time" : "2013-04-17T10:17:43.902+0000",
    "detailType" : "variableUpdate",
    "revision" : 2,
    "variable" : {
    "name" : "myVariable",
    "variableScope", "global",
    "value" : "test"
    },
    "propertyId": null,
    "propertyValue": null
  }
  ],
  "total": 1,
  "start": 0,
  "sort": "name",
  "order": "asc",
  "size": 1
}

15.8.22. Query for historic details

POST query/historic-detail

Request body:

{
  "processInstanceId" : "5",
}

All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of historic process instances, but passed in as JSON-body arguments rather than URL-parameters to allow for more advanced querying and preventing errors with request-uri’s that are too long.

Table 209. Query for historic details - Response codes
Response codeDescription
200Indicates request was successful and the historic details are returned
400Indicates an parameter was passed in the wrong format. The status-message contains additional information.

Success response body:

{
  "data": [
  {
    "id" : "26",
    "processInstanceId" : "5",
    "processInstanceUrl" : "http://localhost:8182/history/historic-process-instances/5",
    "executionId" : "6",
    "activityInstanceId", "10",
    "taskId" : "6",
    "taskUrl" : "http://localhost:8182/history/historic-task-instances/6",
    "time" : "2013-04-17T10:17:43.902+0000",
    "detailType" : "variableUpdate",
    "revision" : 2,
    "variable" : {
    "name" : "myVariable",
    "variableScope", "global",
    "value" : "test"
    },
    "propertyId" : null,
    "propertyValue" : null
  }
  ],
  "total": 1,
  "start": 0,
  "sort": "name",
  "order": "asc",
  "size": 1
}

15.8.23. Get the binary data for a historic detail variable

GET history/historic-detail/{detailId}/data
Table 210. Get the binary data for a historic detail variable - Response codes
Response codeDescription
200Indicates the historic detail instance was found and the requested variable data is returned.
404Indicates the requested historic detail instance was not found or the historic detail instance doesn’t have a variable with the given name or the variable doesn’t have a binary stream available. Status message provides additional information.

Success response body:

The response body contains the binary value of the variable. When the variable is of type binary, the content-type of the response is set to application/octet-stream, regardless of the content of the variable or the request accept-type header. In case of serializable, application/x-java-serialized-object is used as content-type.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文