use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceSequenceCounterTest method testParallelMultiInstance.
@Deployment(resources = { "org/camunda/bpm/engine/test/standalone/entity/ExecutionSequenceCounterTest.testParallelMultiInstance.bpmn20.xml" })
public void testParallelMultiInstance() {
// given
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().orderPartiallyByOccurrence().asc();
// when
String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
// then
query.executionId(processInstanceId);
verifyOrder(query, "theStart", "theService1", "theService3", "theEnd");
List<HistoricActivityInstance> taskActivityInstances = historyService.createHistoricActivityInstanceQuery().activityId("theService2").list();
for (HistoricActivityInstance activityInstance : taskActivityInstances) {
query.executionId(activityInstance.getExecutionId());
verifyOrder(query, "theService2");
}
query = historyService.createHistoricActivityInstanceQuery().orderPartiallyByOccurrence().asc();
verifyOrder(query, "theStart", "theService1", "theService2#multiInstanceBody", "theService2", "theService2", "theService3", "theEnd");
}
use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testHistoricActivityInstanceQueryByCanceled.
@Deployment(resources = "org/camunda/bpm/engine/test/history/HistoricActivityInstanceTest.testHistoricActivityInstanceQueryByCompleteScope.bpmn")
public void testHistoricActivityInstanceQueryByCanceled() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
runtimeService.deleteProcessInstance(processInstance.getId(), "test");
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().canceled();
assertEquals(3, query.count());
List<HistoricActivityInstance> instances = query.list();
for (HistoricActivityInstance instance : instances) {
if (!instance.getActivityId().equals("subprocess") && !instance.getActivityId().equals("userTask1") && !instance.getActivityId().equals("userTask2")) {
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 testInterruptingBoundarySignalEvent.
@Deployment
public void testInterruptingBoundarySignalEvent() {
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());
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 testInterruptingBoundaryTimerEvent.
@Deployment
public void testInterruptingBoundaryTimerEvent() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("process");
Job job = managementService.createJobQuery().singleResult();
assertNotNull(job);
managementService.executeJob(job.getId());
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
query.activityId("timer");
assertEquals(1, query.count());
assertNotNull(query.singleResult().getEndTime());
assertEquals("boundaryTimer", 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 testBoundaryCancelEvent.
@Deployment
public void testBoundaryCancelEvent() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("process");
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
query.activityId("catchCancel");
assertEquals(1, query.count());
assertNotNull(query.singleResult().getEndTime());
assertEquals("cancelBoundaryCatch", query.singleResult().getActivityType());
Task task = taskService.createTaskQuery().singleResult();
taskService.complete(task.getId());
assertProcessEnded(pi.getId());
}
Aggregations