06-26-2018 09:08 AM
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
}
}
],
06-27-2018 08:42 AM
Variables of completed process instances get deleted automatically. I think.
06-27-2018 08:49 AM
no they are saved in the history table,
06-27-2018 08:55 AM
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.
06-27-2018 08:59 AM
I used this uri and he gave me what I was looking for
/history/historic-variable-instances?processInstanceId="+idInstance
06-27-2018 09:04 AM
Now I know.
06-27-2018 09:02 AM
I used this uri and he gave me what I was looking for
history/historic-variable-instances?processInstanceId="+idInstance
Explore our Alfresco products with the links below. Use labels to filter content by product module.