Search in sources :

Example 21 with IncidentQuery

use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.

the class IncidentQueryTest method testQueryByInvalidExecutionId.

@Test
public void testQueryByInvalidExecutionId() {
    IncidentQuery query = runtimeService.createIncidentQuery().executionId("invalid");
    assertEquals(0, query.count());
    List<Incident> incidents = query.list();
    assertTrue(incidents.isEmpty());
    Incident incident = query.singleResult();
    assertNull(incident);
}
Also used : IncidentQuery(org.camunda.bpm.engine.runtime.IncidentQuery) Incident(org.camunda.bpm.engine.runtime.Incident) Test(org.junit.Test)

Example 22 with IncidentQuery

use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.

the class IncidentQueryTest method testQueryByProcessDefinitionId.

public void testQueryByProcessDefinitionId() {
    String processDefinitionId = engineRule.getRepositoryService().createProcessDefinitionQuery().singleResult().getId();
    IncidentQuery query = runtimeService.createIncidentQuery().processDefinitionId(processDefinitionId);
    assertEquals(4, query.count());
    List<Incident> incidents = query.list();
    assertFalse(incidents.isEmpty());
    assertEquals(4, incidents.size());
}
Also used : IncidentQuery(org.camunda.bpm.engine.runtime.IncidentQuery) Incident(org.camunda.bpm.engine.runtime.Incident)

Example 23 with IncidentQuery

use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.

the class IncidentQueryTest method testQueryByActivityId.

public void testQueryByActivityId() {
    IncidentQuery query = runtimeService.createIncidentQuery().activityId("theServiceTask");
    assertEquals(4, query.count());
    List<Incident> incidents = query.list();
    assertFalse(incidents.isEmpty());
    assertEquals(4, incidents.size());
}
Also used : IncidentQuery(org.camunda.bpm.engine.runtime.IncidentQuery) Incident(org.camunda.bpm.engine.runtime.Incident)

Example 24 with IncidentQuery

use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.

the class IncidentQueryTest method testQueryByInvalidProcessDefinitionId.

@Test
public void testQueryByInvalidProcessDefinitionId() {
    IncidentQuery query = runtimeService.createIncidentQuery().processDefinitionId("invalid");
    assertEquals(0, query.count());
    List<Incident> incidents = query.list();
    assertTrue(incidents.isEmpty());
    Incident incident = query.singleResult();
    assertNull(incident);
}
Also used : IncidentQuery(org.camunda.bpm.engine.runtime.IncidentQuery) Incident(org.camunda.bpm.engine.runtime.Incident) Test(org.junit.Test)

Example 25 with IncidentQuery

use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.

the class IncidentQueryTest method testQuery.

@Test
public void testQuery() {
    IncidentQuery query = runtimeService.createIncidentQuery();
    assertEquals(4, query.count());
    List<Incident> incidents = query.list();
    assertFalse(incidents.isEmpty());
    assertEquals(4, incidents.size());
}
Also used : IncidentQuery(org.camunda.bpm.engine.runtime.IncidentQuery) Incident(org.camunda.bpm.engine.runtime.Incident) Test(org.junit.Test)

Aggregations

IncidentQuery (org.camunda.bpm.engine.runtime.IncidentQuery)55 Incident (org.camunda.bpm.engine.runtime.Incident)34 Test (org.junit.Test)21 HistoricIncident (org.camunda.bpm.engine.history.HistoricIncident)7 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)3 Deployment (org.camunda.bpm.engine.test.Deployment)3 IncidentQueryDto (org.camunda.bpm.engine.rest.dto.runtime.IncidentQueryDto)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1 HistoricIncidentQuery (org.camunda.bpm.engine.history.HistoricIncidentQuery)1 RuntimeServiceImpl (org.camunda.bpm.engine.impl.RuntimeServiceImpl)1 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 IncidentDto (org.camunda.bpm.engine.rest.dto.runtime.IncidentDto)1 Execution (org.camunda.bpm.engine.runtime.Execution)1 Job (org.camunda.bpm.engine.runtime.Job)1