Get Activity Instance
curl --request GET \
--url http://{host}:{port}/{contextPath}/process-instance/{id}/activity-instances \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://{host}:{port}/{contextPath}/process-instance/{id}/activity-instances"
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}/process-instance/{id}/activity-instances', 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}/process-instance/{id}/activity-instances",
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}/process-instance/{id}/activity-instances"
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}/process-instance/{id}/activity-instances")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{contextPath}/process-instance/{id}/activity-instances")
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": "eca75c6b-f70c-11e9-8777-e4a7a094a9d6",
"parentActivityInstanceId": null,
"activityId": "invoice:2:e9d77375-f70c-11e9-8777-e4a7a094a9d6",
"activityType": "processDefinition",
"processInstanceId": "eca75c6b-f70c-11e9-8777-e4a7a094a9d6",
"processDefinitionId": "invoice:2:e9d77375-f70c-11e9-8777-e4a7a094a9d6",
"childActivityInstances": [
{
"id": "approveInvoice:eca89509-f70c-11e9-8777-e4a7a094a9d6",
"parentActivityInstanceId": "eca75c6b-f70c-11e9-8777-e4a7a094a9d6",
"activityId": "approveInvoice",
"activityType": "userTask",
"processInstanceId": "eca75c6b-f70c-11e9-8777-e4a7a094a9d6",
"processDefinitionId": "invoice:2:e9d77375-f70c-11e9-8777-e4a7a094a9d6",
"childActivityInstances": [],
"childTransitionInstances": [],
"executionIds": [
"eca75c6b-f70c-11e9-8777-e4a7a094a9d6"
],
"activityName": "Approve Invoice",
"incidentIds": [
"648d7e21-f71c-11e9-a725-e4a7a094a9d6"
],
"incidents": [
{
"id": "648d7e21-f71c-11e9-a725-e4a7a094a9d6",
"activityId": "AttachedTimerBoundaryEvent"
}
],
"name": "Approve Invoice"
}
],
"childTransitionInstances": [],
"executionIds": [
"eca75c6b-f70c-11e9-8777-e4a7a094a9d6"
],
"activityName": "Invoice Receipt",
"incidentIds": null,
"incidents": null,
"name": "Invoice Receipt"
}流程实例
获取活动实例
Retrieves an Activity Instance (Tree) for a given process instance by id.
GET
/
process-instance
/
{id}
/
activity-instances
Get Activity Instance
curl --request GET \
--url http://{host}:{port}/{contextPath}/process-instance/{id}/activity-instances \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://{host}:{port}/{contextPath}/process-instance/{id}/activity-instances"
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}/process-instance/{id}/activity-instances', 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}/process-instance/{id}/activity-instances",
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}/process-instance/{id}/activity-instances"
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}/process-instance/{id}/activity-instances")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{contextPath}/process-instance/{id}/activity-instances")
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": "eca75c6b-f70c-11e9-8777-e4a7a094a9d6",
"parentActivityInstanceId": null,
"activityId": "invoice:2:e9d77375-f70c-11e9-8777-e4a7a094a9d6",
"activityType": "processDefinition",
"processInstanceId": "eca75c6b-f70c-11e9-8777-e4a7a094a9d6",
"processDefinitionId": "invoice:2:e9d77375-f70c-11e9-8777-e4a7a094a9d6",
"childActivityInstances": [
{
"id": "approveInvoice:eca89509-f70c-11e9-8777-e4a7a094a9d6",
"parentActivityInstanceId": "eca75c6b-f70c-11e9-8777-e4a7a094a9d6",
"activityId": "approveInvoice",
"activityType": "userTask",
"processInstanceId": "eca75c6b-f70c-11e9-8777-e4a7a094a9d6",
"processDefinitionId": "invoice:2:e9d77375-f70c-11e9-8777-e4a7a094a9d6",
"childActivityInstances": [],
"childTransitionInstances": [],
"executionIds": [
"eca75c6b-f70c-11e9-8777-e4a7a094a9d6"
],
"activityName": "Approve Invoice",
"incidentIds": [
"648d7e21-f71c-11e9-a725-e4a7a094a9d6"
],
"incidents": [
{
"id": "648d7e21-f71c-11e9-a725-e4a7a094a9d6",
"activityId": "AttachedTimerBoundaryEvent"
}
],
"name": "Approve Invoice"
}
],
"childTransitionInstances": [],
"executionIds": [
"eca75c6b-f70c-11e9-8777-e4a7a094a9d6"
],
"activityName": "Invoice Receipt",
"incidentIds": null,
"incidents": null,
"name": "Invoice Receipt"
}Authorizations
Path Parameters
Response
Request successful.
A JSON object corresponding to the Activity Instance tree of the given process instance.