curl --request GET \
--url http://{host}:{port}/{contextPath}/variable-instance \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://{host}:{port}/{contextPath}/variable-instance"
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}/variable-instance', 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}/variable-instance",
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}/variable-instance"
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}/variable-instance")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{contextPath}/variable-instance")
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": "someId",
"name": "amount",
"type": "Integer",
"value": 5,
"processDefinitionId": "aProcessDefinitionId",
"processInstanceId": "aProcessInstanceId",
"executionId": "b68b71c9-e310-11e2-beb0-f0def1557726",
"taskId": null,
"batchId": null,
"activityInstanceId": "Task_1:b68b71ca-e310-11e2-beb0-f0def1557726",
"caseExecutionId": null,
"caseInstanceId": null,
"errorMessage": null,
"tenantId": null
},
{
"id": "someOtherId",
"name": "amount",
"type": "Integer",
"value": 15,
"processDefinitionId": "aProcessDefinitionId",
"processInstanceId": "aProcessInstanceId",
"executionId": "68b71c9-e310-11e2-beb0-f0def1557726",
"taskId": null,
"batchId": null,
"activityInstanceId": "Task_1:b68b71ca-e310-11e2-beb0-f0def1557726",
"caseExecutionId": null,
"caseInstanceId": null,
"errorMessage": null,
"tenantId": null
},
{
"id": "yetAnotherId",
"name": "amount",
"type": "Integer",
"value": 150,
"processDefinitionId": "aProcessDefinitionId",
"processInstanceId": "anotherProcessInstanceId",
"executionId": "68b71c9-e310-11e2-beb0-f0def1557726",
"taskId": null,
"batchId": null,
"activityInstanceId": "Task_2:b68b71ca-e310-11e2-beb0-f0def1557726",
"caseExecutionId": null,
"caseInstanceId": null,
"errorMessage": null,
"tenantId": null
}
]{
"type": "<string>",
"message": "<string>",
"code": 123
}获取列表
Query for variable instances that fulfill given parameters. Parameters may be the properties of variable instances, such as the name or type. The size of the result set can be retrieved by using the Get Variable Instance Count method.
curl --request GET \
--url http://{host}:{port}/{contextPath}/variable-instance \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://{host}:{port}/{contextPath}/variable-instance"
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}/variable-instance', 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}/variable-instance",
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}/variable-instance"
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}/variable-instance")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{contextPath}/variable-instance")
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": "someId",
"name": "amount",
"type": "Integer",
"value": 5,
"processDefinitionId": "aProcessDefinitionId",
"processInstanceId": "aProcessInstanceId",
"executionId": "b68b71c9-e310-11e2-beb0-f0def1557726",
"taskId": null,
"batchId": null,
"activityInstanceId": "Task_1:b68b71ca-e310-11e2-beb0-f0def1557726",
"caseExecutionId": null,
"caseInstanceId": null,
"errorMessage": null,
"tenantId": null
},
{
"id": "someOtherId",
"name": "amount",
"type": "Integer",
"value": 15,
"processDefinitionId": "aProcessDefinitionId",
"processInstanceId": "aProcessInstanceId",
"executionId": "68b71c9-e310-11e2-beb0-f0def1557726",
"taskId": null,
"batchId": null,
"activityInstanceId": "Task_1:b68b71ca-e310-11e2-beb0-f0def1557726",
"caseExecutionId": null,
"caseInstanceId": null,
"errorMessage": null,
"tenantId": null
},
{
"id": "yetAnotherId",
"name": "amount",
"type": "Integer",
"value": 150,
"processDefinitionId": "aProcessDefinitionId",
"processInstanceId": "anotherProcessInstanceId",
"executionId": "68b71c9-e310-11e2-beb0-f0def1557726",
"taskId": null,
"batchId": null,
"activityInstanceId": "Task_2:b68b71ca-e310-11e2-beb0-f0def1557726",
"caseExecutionId": null,
"caseInstanceId": null,
"errorMessage": null,
"tenantId": null
}
]{
"type": "<string>",
"message": "<string>",
"code": 123
}Authorizations
Query Parameters
Only include variable instances that have the certain values. Value filtering expressions are comma-separated and are structured as follows:
A valid parameter value has the form key_operator_value.
key is the variable name, operator is the comparison operator to be used
and value the variable value.
Note: Values are always treated as String objects on server side.
Valid operator values are: eq - equal to; neq - not equal to; gt -
greater than;
gteq - greater than or equal to; lt - lower than; lteq - lower than or
equal to;
like.
key and value may not contain underscore or comma characters.
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.
Response
Request successful.
A JSON object containing additional, value-type-dependent properties. For serialized variables of type Object, the following properties can be provided:
objectTypeName: A string representation of the object's type name.serializationDataFormat: The serialization format used to store the variable.
For serialized variables of type File, the following properties can be provided:
filename: The name of the file. This is not the variable name but the name that will be used when downloading the file again.mimetype: The MIME type of the file that is being uploaded.encoding: The encoding of the file that is being uploaded.
The following property can be provided for all value types:
transient: Indicates whether the variable should be transient or not. See documentation for more informations. (Not applicable fordecision-definition,/process-instance/variables-async, and/migration/executeAsyncendpoints)