use of org.camunda.bpm.engine.history.HistoricCaseInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceTest method testQueryByInvalidSuperCaseInstanceId.
public void testQueryByInvalidSuperCaseInstanceId() {
HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery();
query.superCaseInstanceId("invalid");
assertEquals(0, query.count());
assertEquals(0, query.list().size());
query.caseInstanceId(null);
assertEquals(0, query.count());
assertEquals(0, query.list().size());
}
use of org.camunda.bpm.engine.history.HistoricCaseInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceTest method testQueryByNonExistingCaseActivityId.
public void testQueryByNonExistingCaseActivityId() {
HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().caseActivityIdIn("nonExisting");
assertEquals(0, query.count());
}
use of org.camunda.bpm.engine.history.HistoricCaseInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceTest method testQueryBySuperCaseInstanceId.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneCaseTaskCase.cmmn", "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn" })
public void testQueryBySuperCaseInstanceId() {
String superCaseInstanceId = caseService.createCaseInstanceByKey("oneCaseTaskCase").getId();
HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().superCaseInstanceId(superCaseInstanceId);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
HistoricCaseInstance caseInstance = query.singleResult();
assertEquals(superCaseInstanceId, caseInstance.getSuperCaseInstanceId());
assertNull(caseInstance.getSuperProcessInstanceId());
}
use of org.camunda.bpm.engine.history.HistoricCaseInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceTest method testQueryBySuperProcessInstanceId.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/superProcessWithCaseCallActivity.bpmn20.xml", "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn" })
public void testQueryBySuperProcessInstanceId() {
String superProcessInstanceId = runtimeService.startProcessInstanceByKey("subProcessQueryTest").getId();
HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().superProcessInstanceId(superProcessInstanceId);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
HistoricCaseInstance subCaseInstance = query.singleResult();
assertNotNull(subCaseInstance);
assertEquals(superProcessInstanceId, subCaseInstance.getSuperProcessInstanceId());
assertNull(subCaseInstance.getSuperCaseInstanceId());
}
use of org.camunda.bpm.engine.history.HistoricCaseInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceTest method testQueryByCaseActivityId.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn" })
public void testQueryByCaseActivityId() {
// given
createCaseInstanceByKey("oneTaskCase");
// when
HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().caseActivityIdIn("PI_HumanTask_1");
// then
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
Aggregations