use of org.camunda.bpm.engine.history.HistoricCaseInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceTest method testQueryByCaseActivityIds.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneCaseTaskCase.cmmn", "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn" })
public void testQueryByCaseActivityIds() {
// given
createCaseInstanceByKey("oneCaseTaskCase");
// when
HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().caseActivityIdIn("PI_HumanTask_1", "PI_CaseTask_1");
// then
assertEquals(2, query.list().size());
assertEquals(2, query.count());
}
use of org.camunda.bpm.engine.history.HistoricCaseInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceTest method testQueryBySubProcessInstanceId.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneProcessTaskCase.cmmn", "org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml" })
public void testQueryBySubProcessInstanceId() {
String superCaseInstanceId = caseService.createCaseInstanceByKey("oneProcessTaskCase").getId();
String subProcessInstanceId = runtimeService.createProcessInstanceQuery().superCaseInstanceId(superCaseInstanceId).singleResult().getId();
HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().subProcessInstanceId(subProcessInstanceId);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
HistoricCaseInstance caseInstance = query.singleResult();
assertEquals(superCaseInstanceId, caseInstance.getId());
assertNull(caseInstance.getSuperCaseInstanceId());
assertNull(caseInstance.getSuperProcessInstanceId());
}
use of org.camunda.bpm.engine.history.HistoricCaseInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceTest method testQueryBySubCaseInstanceId.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneCaseTaskCase.cmmn", "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn" })
public void testQueryBySubCaseInstanceId() {
String superCaseInstanceId = caseService.createCaseInstanceByKey("oneCaseTaskCase").getId();
String subCaseInstanceId = caseService.createCaseInstanceQuery().superCaseInstanceId(superCaseInstanceId).singleResult().getId();
HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().subCaseInstanceId(subCaseInstanceId);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
HistoricCaseInstance caseInstance = query.singleResult();
assertEquals(superCaseInstanceId, caseInstance.getId());
assertNull(caseInstance.getSuperProcessInstanceId());
assertNull(caseInstance.getSuperCaseInstanceId());
}
use of org.camunda.bpm.engine.history.HistoricCaseInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceTest method testDistinctQueryByCaseActivityIds.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/twoTaskCase.cmmn" })
public void testDistinctQueryByCaseActivityIds() {
// given
createCaseInstanceByKey("twoTaskCase");
// when
HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().caseActivityIdIn("PI_HumanTask_1", "PI_HumanTask_2");
// then
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
use of org.camunda.bpm.engine.history.HistoricCaseInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceTest method testQueryByInvalidSubProcessInstanceId.
public void testQueryByInvalidSubProcessInstanceId() {
HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery();
query.subProcessInstanceId("invalid");
assertEquals(0, query.count());
assertEquals(0, query.list().size());
query.caseInstanceId(null);
assertEquals(0, query.count());
assertEquals(0, query.list().size());
}
Aggregations