def processInstanceId = processInstance.getProcessInstanceId()
def historicVariableInstanceQuery = historyService().createHistoricVariableInstanceQuery().processInstanceId(processInstanceId)
historicVariableInstanceQuery.list().each{
println "${it.getName()} : ${it.getTypeName()}: ${it.getClass()}"
}