Unable to retrieve Completed task FormVariables

Hi,

Is there any way to retrieve form variables of completed tasks using REST API?

The following service retrieve only active tasks form variables.
http://localhost:8080/engine-rest/task/2640ff7e-6404-11e7-afe0-98541bf26151/form-variables
http://localhost:8080/engine-rest/process-instance/327480f4-5eef-11e7-aa84-308920524153/variables

If I am using completed task id or process id its giving me following error.
{"type":"NullValueException","message":"execution 327480f4-5eef-11e7-aa84-308920524153 doesn't exist: execution is null"}
I thinks once task get completed it may be get removed with all variables from camunda run time Env db.
.
I searched a lot also in REST API->History, but didn’t get REST API as like for active tasks(which are above).
Also tried to use GET /history/variable-instance but it gives me every variable as instance.

There is a UI page of third party application which only shows active and completed tasks.
I thinks there should be REST Api available which give me form variables as like i am retrieving for active tasks.

Thank you,
Jignesh Pithva.

Hi,

the /history/variable-instance is the correct resource.
You can use the parameter taskIdIn, if you have the task ID of the completed Task or the processInstanceId to query for the variable instances.

Greets,
Chris

Hi Chris Thank you.

I think this is the way to retrieve completed task form variables by filtering taskIdIn or processInstanceId.

Thank you,
Jignesh Pithva.