taskService.setVariableLocal(task.getId(), "aNewLocalTaskVariableName", "aNewLockTaskVariableValue");
// change task variable value
taskService.setVariableLocal(task.getId(), "aLocalTaskVariableName", "aNewValue");
Assert.assertEquals(3, variableInstanceQuery.taskIdIn(task.getId()).count());
// complete task
taskService.complete(task.getId());
variableInstanceQuery = getClearVariableInstanceQuery(pi.getId());