use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testStartEventTypes.
@Deployment(resources = "org/camunda/bpm/engine/test/history/HistoricActivityInstanceTest.testEvents.bpmn")
public void testStartEventTypes() {
HistoricActivityInstanceQuery query = startEventTestProcess("");
query.activityId("timerStartEvent");
assertEquals(1, query.count());
assertEquals("startTimerEvent", query.singleResult().getActivityType());
query.activityId("noneStartEvent");
assertEquals(1, query.count());
assertEquals("startEvent", query.singleResult().getActivityType());
query = startEventTestProcess("CAM-2365");
query.activityId("messageStartEvent");
assertEquals(1, query.count());
assertEquals("messageStartEvent", query.singleResult().getActivityType());
}
use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testHistoricActivityInstanceQueryByCompleteScope.
@Deployment
public void testHistoricActivityInstanceQueryByCompleteScope() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
List<Task> tasks = taskService.createTaskQuery().list();
for (Task task : tasks) {
taskService.complete(task.getId());
}
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().completeScope();
assertEquals(3, query.count());
List<HistoricActivityInstance> instances = query.list();
for (HistoricActivityInstance instance : instances) {
if (!instance.getActivityId().equals("innerEnd") && !instance.getActivityId().equals("end1") && !instance.getActivityId().equals("end2")) {
fail("Unexpected instance with activity id " + instance.getActivityId() + " found.");
}
}
assertProcessEnded(processInstance.getId());
}
use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testNonInterruptingBoundarySignalEvent.
@Deployment
public void testNonInterruptingBoundarySignalEvent() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("process");
Execution execution = runtimeService.createExecutionQuery().signalEventSubscriptionName("newSignal").singleResult();
runtimeService.signalEventReceived("newSignal", execution.getId());
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
query.activityId("signal");
assertEquals(1, query.count());
assertNotNull(query.singleResult().getEndTime());
assertEquals("boundarySignal", query.singleResult().getActivityType());
List<Task> tasks = taskService.createTaskQuery().list();
for (Task task : tasks) {
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 testNonInterruptingBoundaryMessageEvent.
@Deployment
public void testNonInterruptingBoundaryMessageEvent() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("process");
Execution execution = runtimeService.createExecutionQuery().messageEventSubscriptionName("newMessage").singleResult();
runtimeService.messageEventReceived("newMessage", execution.getId());
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
query.activityId("message");
assertEquals(1, query.count());
assertNotNull(query.singleResult().getEndTime());
assertEquals("boundaryMessage", query.singleResult().getActivityType());
List<Task> tasks = taskService.createTaskQuery().list();
for (Task task : tasks) {
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 testCompensationServiceTaskHasEndTime.
@Deployment(resources = "org/camunda/bpm/engine/test/history/HistoricActivityInstanceTest.testBoundaryCompensateEvent.bpmn20.xml")
public void testCompensationServiceTaskHasEndTime() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("process");
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
query.activityId("compensationServiceTask");
assertEquals(1, query.count());
assertNotNull(query.singleResult().getEndTime());
assertProcessEnded(pi.getId());
}
Aggregations