您好,我使用j2ee和activiti-rest来创建此函数来获取流程实例的变量列表,该函数将所有信息返回给我,但我希望我不需要任何其他变量列表信息,我如何访问钩子之间的变量信息,我想以粗体显示信息
这是代码:
public List<HistoricVariableInstance> ListVariableOfCompletedInstance()
throws
JSONException, IOException {
JSONArray VariablesArray =
ProcessController.getService("/history/historic-variable-instances?
processInstanceId="+idInstance);
try {
Gson gson = new Gson();
List<HistoricVariableInstance> listVariableOfinsatance =
gson.fromJson(VariablesArray.toString(), List.class);
System.out.println(listVariableOfinsatance.size());
System.out.println("la liste des variables:" +listVariableOfinsatance);
return listVariableOfinsatance;
} catch (Exception e) {
}
return null;
}
the response :
{
"data": [
{
"id": "40406",
"processInstanceId": "40398",
"processInstanceUrl": "http://10.6.99.57:8888/activiti-
rest/service/history/historic-process-instances/40398",
"taskId": null,
"variable": {
"name": "nbj",
"type": "string",
"value": "3",
"scope": null
}
},
{
"id": "40408",
"processInstanceId": "40398",
"processInstanceUrl": "http://10.6.99.57:8888/activiti-
rest/service/history/historic-process-instances/40398",
"taskId": null,
"variable": {
"name": "nom",
"type": "string",
"value": "yasmine",
"scope": null
}
},
{
"id": "40404",
"processInstanceId": "40398",
"processInstanceUrl": "http://10.6.99.57:8888/activiti-
rest/service/history/historic-process-instances/40398",
"taskId": null,
"variable": {
"name": "reponse",
"type": "string",
"value": "1",
"scope": null
}
}
],