use of org.camunda.bpm.engine.history.HistoricTaskInstance in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceUpdateTest method testHistoricTaskInstanceUpdate.
@Deployment
public void testHistoricTaskInstanceUpdate() {
runtimeService.startProcessInstanceByKey("HistoricTaskInstanceTest").getId();
Task task = taskService.createTaskQuery().singleResult();
// Update and save the task's fields before it is finished
task.setPriority(12345);
task.setDescription("Updated description");
task.setName("Updated name");
task.setAssignee("gonzo");
taskService.saveTask(task);
taskService.complete(task.getId());
assertEquals(1, historyService.createHistoricTaskInstanceQuery().count());
HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().singleResult();
assertEquals("Updated name", historicTaskInstance.getName());
assertEquals("Updated description", historicTaskInstance.getDescription());
assertEquals("gonzo", historicTaskInstance.getAssignee());
assertEquals("task", historicTaskInstance.getTaskDefinitionKey());
}
Aggregations