variables.put("aVariable", 1234);
ProcessInstance pi = runtimeService.startProcessInstanceByKey("taskAssigneeProcess", variables);
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableName("aVariable");
VariableInstance variable = query.singleResult();
assertEquals(ValueType.INTEGER.getName(), variable.getTypeName());
runtimeService.setVariable(pi.getId(), "aVariable", 1234L);
variable = query.singleResult();
assertEquals(ValueType.LONG.getName(), variable.getTypeName());
runtimeService.setVariable(pi.getId(), "aVariable", (short)1234);
variable = query.singleResult();
assertEquals(ValueType.SHORT.getName(), variable.getTypeName());
}