use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class HistoricIncidentTest method testCreateRecursiveHistoricIncidents.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricIncidentQueryTest.testQueryByCauseIncidentId.bpmn20.xml", "org/camunda/bpm/engine/test/api/runtime/oneFailingServiceProcess.bpmn20.xml" })
public void testCreateRecursiveHistoricIncidents() {
startProcessInstance("process");
ProcessInstance pi1 = runtimeService.createProcessInstanceQuery().processDefinitionKey("process").singleResult();
assertNotNull(pi1);
ProcessInstance pi2 = runtimeService.createProcessInstanceQuery().processDefinitionKey(PROCESS_DEFINITION_KEY).singleResult();
assertNotNull(pi2);
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery();
HistoricIncident rootCauseHistoricIncident = query.processInstanceId(pi2.getId()).singleResult();
assertNotNull(rootCauseHistoricIncident);
// cause and root cause id is equal to the id of the root incident
assertEquals(rootCauseHistoricIncident.getId(), rootCauseHistoricIncident.getCauseIncidentId());
assertEquals(rootCauseHistoricIncident.getId(), rootCauseHistoricIncident.getRootCauseIncidentId());
HistoricIncident historicIncident = query.processInstanceId(pi1.getId()).singleResult();
assertNotNull(historicIncident);
// cause and root cause id is equal to the id of the root incident
assertEquals(rootCauseHistoricIncident.getId(), historicIncident.getCauseIncidentId());
assertEquals(rootCauseHistoricIncident.getId(), historicIncident.getRootCauseIncidentId());
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class HistoricIncidentQueryTest method testQueryByInvalidConfigurationId.
@Test
public void testQueryByInvalidConfigurationId() {
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery();
assertEquals(0, query.configuration("invalid").list().size());
assertEquals(0, query.configuration("invalid").count());
try {
query.configuration(null);
fail("It was possible to set a null value as configuration.");
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class HistoricIncidentQueryTest method testQueryByDeleted.
@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/oneFailingServiceProcess.bpmn20.xml" })
public void testQueryByDeleted() {
startProcessInstance(PROCESS_DEFINITION_KEY);
String processInstanceId = runtimeService.createProcessInstanceQuery().singleResult().getId();
runtimeService.deleteProcessInstance(processInstanceId, null);
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery().deleted();
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class HistoricIncidentQueryTest method testQueryByInvalidRootCauseIncidentId.
@Test
public void testQueryByInvalidRootCauseIncidentId() {
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery();
assertEquals(0, query.rootCauseIncidentId("invalid").list().size());
assertEquals(0, query.rootCauseIncidentId("invalid").count());
try {
query.rootCauseIncidentId(null);
fail("It was possible to set a null value as rootCauseIncidentId.");
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class HistoricIncidentQueryTest method testQueryByInvalidExecutionId.
@Test
public void testQueryByInvalidExecutionId() {
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery();
assertEquals(0, query.executionId("invalid").list().size());
assertEquals(0, query.executionId("invalid").count());
try {
query.executionId(null);
fail("It was possible to set a null value as executionId.");
} catch (ProcessEngineException e) {
}
}
Aggregations