use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testIntermediateCatchEventTypes.
@Deployment(resources = "org/camunda/bpm/engine/test/history/HistoricActivityInstanceTest.testEvents.bpmn")
public void testIntermediateCatchEventTypes() {
HistoricActivityInstanceQuery query = startEventTestProcess("");
query.activityId("intermediateSignalCatchEvent");
assertEquals(1, query.count());
assertEquals("intermediateSignalCatch", query.singleResult().getActivityType());
query.activityId("intermediateMessageCatchEvent");
assertEquals(1, query.count());
assertEquals("intermediateMessageCatch", query.singleResult().getActivityType());
query.activityId("intermediateTimerCatchEvent");
assertEquals(1, query.count());
assertEquals("intermediateTimer", query.singleResult().getActivityType());
}
use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testHistoricActivityInstanceGatewayEndTimes.
/**
* https://app.camunda.com/jira/browse/CAM-1537
*/
@Deployment
public void testHistoricActivityInstanceGatewayEndTimes() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("gatewayEndTimes");
TaskQuery query = taskService.createTaskQuery().orderByTaskName().asc();
List<Task> tasks = query.list();
taskService.complete(tasks.get(0).getId());
taskService.complete(tasks.get(1).getId());
// process instance should have finished
assertNotNull(historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstance.getId()).singleResult().getEndTime());
// gateways should have end timestamps
assertNotNull(historyService.createHistoricActivityInstanceQuery().activityId("Gateway_0").singleResult().getEndTime());
// there exists two historic activity instances for "Gateway_1" (parallel join)
HistoricActivityInstanceQuery historicActivityInstanceQuery = historyService.createHistoricActivityInstanceQuery().activityId("Gateway_1");
assertEquals(2, historicActivityInstanceQuery.count());
// they should have an end timestamp
assertNotNull(historicActivityInstanceQuery.list().get(0).getEndTime());
assertNotNull(historicActivityInstanceQuery.list().get(1).getEndTime());
}
use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testScopeActivity.
@Deployment
public void testScopeActivity() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("process");
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
query.activityId("userTask");
assertEquals(1, query.count());
HistoricActivityInstance historicActivityInstance = query.singleResult();
assertEquals(pi.getId(), historicActivityInstance.getParentActivityInstanceId());
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 testInterruptingBoundaryMessageEvent.
@Deployment
public void testInterruptingBoundaryMessageEvent() {
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());
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 HistoricActivityInstanceSequenceCounterTest method testLoop.
@Deployment(resources = { "org/camunda/bpm/engine/test/standalone/entity/ExecutionSequenceCounterTest.testLoop.bpmn20.xml" })
public void testLoop() {
// given
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().orderPartiallyByOccurrence().asc();
// when
String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
// then
query.executionId(processInstanceId);
verifyOrder(query, "theStart", "theService1", "join", "theScript", "fork", "join", "theScript", "fork", "theService2", "theEnd");
}
Aggregations