AnsweredAssumed Answered

howa  to get varibales of  completed instances using activiti-rest and j2ee

Question asked by mobarkiyasmine on Jun 26, 2018
Latest reply on Jun 27, 2018 by savo

Hello i work with j2ee and activiti-rest i create this function to get the list of variables of a process intsance, the function returns all information to me but I want to have that the list of variables I do not need any other information how I can access the variable information that is between hook ,i want to have informations in  bold

 

this is the code :

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
}
}
],

Outcomes