API java: get old variable value

Hi, I have an active process with three tasks (task1, task2, task3) and one variable "name". Each task sets the value of the variable name: task1 => name = 'Pippo' task2 => name = 'Pluto' task3 => name = 'Mario'

Using processAPI.getProcessDataInstances or processAPI.getArchivedProcessDataInstances Bonita always returns the value of task3 Mario.

How should I do to get the value of the task1 'Pippo'?

Thanks Manolo