I have wrote a demo command to set variables history enabled, but it seems that the variables was saved to jbpm4_hist_var, but the variable's value was doesn't saved.
In the source code, I saw that the HistoryVariableImpl was created before setValue , and the HistoryVarialbeUpdate event was fired in setValue, but there's no session.save() for the HistoryVariableUpdateImpl , so is it the reason?
Variable history isnt completely worked out yet, should be in one of the next releases.