use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceTest method testQueryByInvalidCaseInstanceId.
public void testQueryByInvalidCaseInstanceId() {
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
query.caseInstanceId("invalid");
assertEquals(0, query.count());
assertEquals(0, query.list().size());
assertNull(query.singleResult());
query.caseInstanceId(null);
assertEquals(0, query.count());
assertEquals(0, query.list().size());
assertNull(query.singleResult());
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceTest method testQueryByProcessInstanceBusinessKeyAndArray.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" })
public void testQueryByProcessInstanceBusinessKeyAndArray() {
// given
String businessKey1 = "BUSINESS-KEY-1";
String businessKey2 = "BUSINESS-KEY-2";
String businessKey3 = "BUSINESS-KEY-3";
String unexistingBusinessKey = "unexistingBusinessKey";
runtimeService.startProcessInstanceByKey("oneTaskProcess", businessKey1);
runtimeService.startProcessInstanceByKey("oneTaskProcess", businessKey2);
runtimeService.startProcessInstanceByKey("oneTaskProcess", businessKey3);
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
// then
assertEquals(0, query.processInstanceBusinessKeyIn(businessKey1, businessKey2).processInstanceBusinessKey(unexistingBusinessKey).count());
assertEquals(1, query.processInstanceBusinessKeyIn(businessKey2, businessKey3).processInstanceBusinessKey(businessKey2).count());
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceTest method testQueryByProcessInstanceBusinessKeyIn.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" })
public void testQueryByProcessInstanceBusinessKeyIn() {
// given
String businessKey1 = "BUSINESS-KEY-1";
String businessKey2 = "BUSINESS-KEY-2";
String businessKey3 = "BUSINESS-KEY-3";
String unexistingBusinessKey = "unexistingBusinessKey";
runtimeService.startProcessInstanceByKey("oneTaskProcess", businessKey1);
runtimeService.startProcessInstanceByKey("oneTaskProcess", businessKey2);
runtimeService.startProcessInstanceByKey("oneTaskProcess", businessKey3);
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
// then
assertEquals(3, query.processInstanceBusinessKeyIn(businessKey1, businessKey2, businessKey3).list().size());
assertEquals(1, query.processInstanceBusinessKeyIn(businessKey2, unexistingBusinessKey).count());
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceTest method testQueryByInvalidCaseExecutionId.
public void testQueryByInvalidCaseExecutionId() {
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
query.caseExecutionId("invalid");
assertEquals(0, query.count());
assertEquals(0, query.list().size());
assertNull(query.singleResult());
query.caseExecutionId(null);
assertEquals(0, query.count());
assertEquals(0, query.list().size());
assertNull(query.singleResult());
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceTest method testQueryByTaskDefinitionKey.
@Deployment(resources = "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml")
public void testQueryByTaskDefinitionKey() {
// given
runtimeService.startProcessInstanceByKey("oneTaskProcess");
// when
HistoricTaskInstanceQuery query1 = historyService.createHistoricTaskInstanceQuery().taskDefinitionKey("theTask");
HistoricTaskInstanceQuery query2 = historyService.createHistoricTaskInstanceQuery().taskDefinitionKeyIn("theTask");
// then
assertEquals(1, query1.count());
assertEquals(1, query2.count());
}
Aggregations