You can configure jBPM to store the old processinstanceinfos to a table named processinstancelog.
See the docs about HistoryLog: http://docs.jboss.org/jbpm/v5.4/userguide/ch.core-persistence.html#d0e3856
before you start your process. It enables history..
JPAWorkingMemoryDbLogger logger2 = new JPAWorkingMemoryDbLogger(kSession);
this is in fact by design. process instance info should be only kept until process instance is finished (completed or aborted) to be able to resume it when needed. As colleagues above have already mentioned you should use history log to preserve information about process instance once it's finished.
But the information in the VariableInstanceLog is not accurate:
1. Everything is converted to string
2. Size of the field is 255. I even tried changing the field to a higher value and it did not work. Then I found the 255 character limit is imposed by the code itself.
3. It gets updated everytime a variable is submitted such as from a human task form. So we send up having multiple records for the same variable. Yes, the one with the biggest ID is the most current one, but this is not efficient for storing variable data
My question is how can we keep all he variables of the process even after the process ends, so we can always query that information later. In real life, for example, someone may want to go back and check a credit application even after it was declined(say this was being questioned by a manager) .
I am using 5.4, by the way.