use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentQueryTest method testQueryByCauseIncidentIdEqualsNull.
@Test
public void testQueryByCauseIncidentIdEqualsNull() {
IncidentQuery query = runtimeService.createIncidentQuery().causeIncidentId(null);
assertEquals(4, query.count());
List<Incident> incidents = query.list();
assertFalse(incidents.isEmpty());
assertEquals(4, incidents.size());
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentQueryTest method testQueryByProcessInstanceId.
public void testQueryByProcessInstanceId() {
IncidentQuery query = runtimeService.createIncidentQuery().processInstanceId(processInstanceIds.get(0));
assertEquals(1, query.count());
List<Incident> incidents = query.list();
assertFalse(incidents.isEmpty());
assertEquals(1, incidents.size());
Incident incident = query.singleResult();
assertNotNull(incident);
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentQueryTest method testQueryByIncidentId.
@Test
public void testQueryByIncidentId() {
Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstanceIds.get(0)).singleResult();
assertNotNull(incident);
IncidentQuery query = runtimeService.createIncidentQuery().incidentId(incident.getId());
assertEquals(1, query.count());
List<Incident> incidents = query.list();
assertFalse(incidents.isEmpty());
assertEquals(1, incidents.size());
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentQueryTest method testQueryByJobDefinitionId.
@Test
public void testQueryByJobDefinitionId() {
String processDefinitionId1 = testHelper.deployAndGetDefinition(FAILING_SERVICE_TASK_MODEL).getId();
String processDefinitionId2 = testHelper.deployAndGetDefinition(FAILING_SERVICE_TASK_MODEL).getId();
runtimeService.startProcessInstanceById(processDefinitionId1);
runtimeService.startProcessInstanceById(processDefinitionId2);
testHelper.executeAvailableJobs();
String jobDefinitionId1 = managementService.createJobQuery().processDefinitionId(processDefinitionId1).singleResult().getJobDefinitionId();
String jobDefinitionId2 = managementService.createJobQuery().processDefinitionId(processDefinitionId2).singleResult().getJobDefinitionId();
IncidentQuery query = runtimeService.createIncidentQuery().jobDefinitionIdIn(jobDefinitionId1, jobDefinitionId2);
assertEquals(2, query.list().size());
assertEquals(2, query.count());
query = runtimeService.createIncidentQuery().jobDefinitionIdIn(jobDefinitionId1);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
query = runtimeService.createIncidentQuery().jobDefinitionIdIn(jobDefinitionId2);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentQueryTest method testQueryByExecutionId.
public void testQueryByExecutionId() {
Execution execution = runtimeService.createExecutionQuery().processInstanceId(processInstanceIds.get(0)).singleResult();
assertNotNull(execution);
IncidentQuery query = runtimeService.createIncidentQuery().executionId(execution.getId());
assertEquals(1, query.count());
List<Incident> incidents = query.list();
assertFalse(incidents.isEmpty());
assertEquals(1, incidents.size());
}
Aggregations