public void testResolvesVariablesFromDifferentScopes() {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("assignee", "michael");
runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);
Task task = taskService.createTaskQuery().singleResult();
assertEquals("michael", task.getAssignee());
variables.put("assignee", "johnny");
ProcessInstance secondInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);
task = taskService.createTaskQuery().processInstanceId(secondInstance.getId()).singleResult();
assertEquals("johnny", task.getAssignee());
}