use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testMultiInstanceReceiveActivity.
@Deployment
public void testMultiInstanceReceiveActivity() {
runtimeService.startProcessInstanceByKey("process");
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
HistoricActivityInstance miBodyInstance = query.activityId("receiveTask#multiInstanceBody").singleResult();
query.activityId("receiveTask");
assertEquals(5, query.count());
List<HistoricActivityInstance> result = query.list();
for (HistoricActivityInstance instance : result) {
assertEquals(miBodyInstance.getId(), instance.getParentActivityInstanceId());
}
}
use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testIntermediateThrowEventTypes.
@Deployment(resources = "org/camunda/bpm/engine/test/history/HistoricActivityInstanceTest.testEvents.bpmn")
public void testIntermediateThrowEventTypes() {
HistoricActivityInstanceQuery query = startEventTestProcess("");
query.activityId("intermediateSignalThrowEvent");
assertEquals(1, query.count());
assertEquals("intermediateSignalThrow", query.singleResult().getActivityType());
query.activityId("intermediateMessageThrowEvent");
assertEquals(1, query.count());
assertEquals("intermediateMessageThrowEvent", query.singleResult().getActivityType());
query.activityId("intermediateNoneThrowEvent");
assertEquals(1, query.count());
assertEquals("intermediateNoneThrowEvent", query.singleResult().getActivityType());
query.activityId("intermediateCompensationThrowEvent");
assertEquals(1, query.count());
assertEquals("intermediateCompensationThrowEvent", query.singleResult().getActivityType());
}
use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testBoundaryErrorEvent.
@Deployment
public void testBoundaryErrorEvent() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("process");
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
query.activityId("error");
assertEquals(1, query.count());
assertNotNull(query.singleResult().getEndTime());
assertEquals("boundaryError", query.singleResult().getActivityType());
Task task = taskService.createTaskQuery().singleResult();
taskService.complete(task.getId());
assertProcessEnded(pi.getId());
}
use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testAssigneeSavedWhenTaskSaved.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricActivityInstanceTest.testHistoricActivityInstanceProperties.bpmn20.xml" })
public void testAssigneeSavedWhenTaskSaved() {
// given
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().activityId("theTask");
runtimeService.startProcessInstanceByKey("taskAssigneeProcess");
HistoricActivityInstance historicActivityInstance = query.singleResult();
Task task = taskService.createTaskQuery().singleResult();
// assume
assertEquals("kermit", historicActivityInstance.getAssignee());
// when
task.setAssignee("gonzo");
taskService.saveTask(task);
// then
historicActivityInstance = query.singleResult();
assertEquals("gonzo", historicActivityInstance.getAssignee());
}
Aggregations