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
}
}
],
Variables of completed process instances get deleted automatically. I think.
no they are saved in the history table,
Using the api to get the variables of processes, you are able to do so only for unfinished ones. If a process is finished it would say something like "process not found".
That's why I think they get deleted. But I could be wrong.
I used this uri and he gave me what I was looking for
/history/historic-variable-instances?processInstanceId="+idInstance
I used this uri and he gave me what I was looking for
history/historic-variable-instances?processInstanceId="+idInstance
Now I know.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.