use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricActivityInstanceQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(4L));
}
use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricActivityInstanceQueryTest method testQueryAuthenticatedTenant.
public void testQueryAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
assertThat(query.count(), is(2L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(2L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
assertThat(query.tenantIdIn(TENANT_ONE, TENANT_TWO).count(), is(2L));
}
use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class CompleteProcessWithParallelGatewayAndServiceTaskTest method testCompleteProcessWithParallelGateway.
@Test
@ScenarioUnderTest("init.none.1")
public void testCompleteProcessWithParallelGateway() {
// given an already started process instance with one user task
ProcessInstance oldInstance = rule.processInstance();
Assert.assertNotNull(oldInstance);
Task task = rule.taskQuery().singleResult();
Assert.assertNotNull(task);
// and completed service task
HistoricActivityInstanceQuery historicActQuery = rule.getHistoryService().createHistoricActivityInstanceQuery().activityType("serviceTask").processInstanceId(oldInstance.getId()).finished();
Assert.assertEquals(1, historicActQuery.count());
// when completing the user task
rule.getTaskService().complete(task.getId());
// then there exists no more tasks
// and the process instance is also completed
Assert.assertEquals(0, rule.taskQuery().count());
rule.assertScenarioEnded();
}
use of org.camunda.bpm.engine.history.HistoricActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testNonInterruptingBoundaryTimerEvent.
@Deployment
public void testNonInterruptingBoundaryTimerEvent() {
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());
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 testEndEventTypes.
@Deployment(resources = "org/camunda/bpm/engine/test/history/HistoricActivityInstanceTest.testEvents.bpmn")
public void testEndEventTypes() {
HistoricActivityInstanceQuery query = startEventTestProcess("");
query.activityId("cancellationEndEvent");
assertEquals(1, query.count());
assertEquals("cancelEndEvent", query.singleResult().getActivityType());
query.activityId("messageEndEvent");
assertEquals(1, query.count());
assertEquals("messageEndEvent", query.singleResult().getActivityType());
query.activityId("errorEndEvent");
assertEquals(1, query.count());
assertEquals("errorEndEvent", query.singleResult().getActivityType());
query.activityId("signalEndEvent");
assertEquals(1, query.count());
assertEquals("signalEndEvent", query.singleResult().getActivityType());
query.activityId("terminationEndEvent");
assertEquals(1, query.count());
assertEquals("terminateEndEvent", query.singleResult().getActivityType());
query.activityId("noneEndEvent");
assertEquals(1, query.count());
assertEquals("noneEndEvent", query.singleResult().getActivityType());
}
Aggregations