1、查询执行
请求正文:
{
"processDefinitionKey":"oneTaskProcess",
"variables":
[
{
"name" : "myVariable",
"value" : 1234,
"operation" : "equals",
"type" : "long"
}
],
"processInstanceVariables":
[
{
"name" : "processVariable",
"value" : "some string",
"operation" : "equals",
"type" : "string"
}
]
}
请求主体可以包含所有可用的过滤器,可以在列表执行 URL查询中使用。最重要的是,可以 在查询中提供一个数组variables和processInstanceVariables一个包含在这里的格式。
一般的分页和排序查询参数可以用于这个URL。
表1.查询执行 - 响应代码
响应码 | 描述 |
---|---|
200 | 指示请求成功并返回执行 |
400 表示参数传递格式错误。状态消息包含附加信息。 |
成功回应机构:
{
"data":[
{
"id":"5",
"url":"http://localhost:8182/runtime/executions/5",
"parentId":null,
"parentUrl":null,
"processInstanceId":"5",
"processInstanceUrl":"http://localhost:8182/runtime/process-instances/5",
"suspended":false,
"activityId":null,
"tenantId":null
},
{
"id":"7",
"url":"http://localhost:8182/runtime/executions/7",
"parentId":"5",
"parentUrl":"http://localhost:8182/runtime/executions/5",
"processInstanceId":"5",
"processInstanceUrl":"http://localhost:8182/runtime/process-instances/5",
"suspended":false,
"activityId":"processTask",
"tenantId":null
}
],
"total":2,
"start":0,
"sort":"processInstanceId",
"order":"asc",
"size":2
}
2、执行的变量列表
表2.执行的变量列表 - URL参数
参数 | 需要 | 值 | 描述 |
---|---|---|---|
流程id | 是 | 串 | 执行到变量的id。 |
范围 | 没有 | 串 | 无论是local或global。如果省略,则返回本地和全局作用域变量。 |
表3.执行的变量列表 - 响应代码
响应码 | 描述 |
---|---|
200 | 指示找到执行并返回变量。 |
404 | 指示未找到请求的执行。 |
成功回应机构:
[
{
"name":"intProcVar",
"type":"integer",
"value":123,
"scope":"global"
},
{
"name":"byteArrayProcVar",
"type":"binary",
"value":null,
"valueUrl":"http://localhost:8182/runtime/process-instances/5/variables/byteArrayProcVar/data",
"scope":"local"
}
]
如果变量是二进制变量或可序列化的,则valueUrl指向一个URL以获取原始值。如果它是一个普通变量,则该值出现在响应中。