@Deployment public void testHistoricTaskInstanceAssignmentListener() { Map<String, Object> variables = new HashMap<String, Object>(); variables.put("assignee", "jonny"); runtimeService.startProcessInstanceByKey("testProcess", variables); HistoricActivityInstance hai = historyService.createHistoricActivityInstanceQuery().activityId("task").singleResult(); assertEquals("jonny", hai.getAssignee()); HistoricTaskInstance hti = historyService.createHistoricTaskInstanceQuery().singleResult(); assertEquals("jonny", hti.getAssignee()); assertNull(hti.getOwner()); }
@Deployment public void testSetVariableLocalOnServiceTaskInsideParallelBranch() { ProcessInstance pi = runtimeService.startProcessInstanceByKey("process"); HistoricActivityInstance serviceTask = historyService .createHistoricActivityInstanceQuery() .activityId("serviceTask1") .singleResult(); assertNotNull(serviceTask); HistoricVariableInstanceQuery query = historyService.createHistoricVariableInstanceQuery(); assertEquals(1, query.count()); HistoricVariableInstance variable = query.singleResult(); // the variable is in the service task scope assertEquals(serviceTask.getId(), variable.getActivityInstanceId()); assertProcessEnded(pi.getId()); }