Get
curl --request GET \
--url http://{host}:{port}/{contextPath}/history/process-instance/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://{host}:{port}/{contextPath}/history/process-instance/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('http://{host}:{port}/{contextPath}/history/process-instance/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "http://{host}:{port}/{contextPath}/history/process-instance/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://{host}:{port}/{contextPath}/history/process-instance/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://{host}:{port}/{contextPath}/history/process-instance/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{contextPath}/history/process-instance/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"id": "7c80cc8f-ef95-11e6-b6e6-34f39ab71d4e",
"businessKey": null,
"processDefinitionId": "invoice:1:7bf79f13-ef95-11e6-b6e6-34f39ab71d4e",
"processDefinitionKey": "invoice",
"processDefinitionName": "Invoice Receipt",
"processDefinitionVersion": 1,
"startTime": "2017-02-10T14:33:19.000+0200",
"endTime": null,
"removalTime": null,
"durationInMillis": null,
"startUserId": null,
"startActivityId": "StartEvent_1",
"deleteReason": null,
"rootProcessInstanceId": "f8259e5d-ab9d-11e8-8449-e4a7a094a9d6",
"superProcessInstanceId": null,
"superCaseInstanceId": null,
"caseInstanceId": null,
"tenantId": null,
"state": "ACTIVE",
"restartedProcessInstanceId": "2bef365d-3406-11ef-bd73-0a0027000003"
}历史流程实例
根据Id获取
Retrieves a historic process instance by id, according to the HistoricProcessInstance interface in the engine.
GET
/
history
/
process-instance
/
{id}
Get
curl --request GET \
--url http://{host}:{port}/{contextPath}/history/process-instance/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://{host}:{port}/{contextPath}/history/process-instance/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('http://{host}:{port}/{contextPath}/history/process-instance/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "http://{host}:{port}/{contextPath}/history/process-instance/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://{host}:{port}/{contextPath}/history/process-instance/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://{host}:{port}/{contextPath}/history/process-instance/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{contextPath}/history/process-instance/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"id": "7c80cc8f-ef95-11e6-b6e6-34f39ab71d4e",
"businessKey": null,
"processDefinitionId": "invoice:1:7bf79f13-ef95-11e6-b6e6-34f39ab71d4e",
"processDefinitionKey": "invoice",
"processDefinitionName": "Invoice Receipt",
"processDefinitionVersion": 1,
"startTime": "2017-02-10T14:33:19.000+0200",
"endTime": null,
"removalTime": null,
"durationInMillis": null,
"startUserId": null,
"startActivityId": "StartEvent_1",
"deleteReason": null,
"rootProcessInstanceId": "f8259e5d-ab9d-11e8-8449-e4a7a094a9d6",
"superProcessInstanceId": null,
"superCaseInstanceId": null,
"caseInstanceId": null,
"tenantId": null,
"state": "ACTIVE",
"restartedProcessInstanceId": "2bef365d-3406-11ef-bd73-0a0027000003"
}Authorizations
Response
Request successful.
The time the instance was started. Default format yyyy-MM-dd'T'HH:mm:ss.SSSZ.
The time the instance ended. Default format yyyy-MM-dd'T'HH:mm:ss.SSSZ.
The time after which the instance should be removed by the History Cleanup job. Default format yyyy-MM-dd'T'HH:mm:ss.SSSZ.
Last state of the process instance, possible values are:
ACTIVE - running process instance
SUSPENDED - suspended process instances
COMPLETED - completed through normal end event
EXTERNALLY_TERMINATED - terminated externally, for instance through REST API
INTERNALLY_TERMINATED - terminated internally, for instance by terminating boundary event
Available options:
ACTIVE, SUSPENDED, COMPLETED, EXTERNALLY_TERMINATED, INTERNALLY_TERMINATED