Package org.camunda.bpm.engine.runtime

Examples of org.camunda.bpm.engine.runtime.Incident


    String processInstanceId = runtimeService.createProcessInstanceQuery()
        .processDefinitionKey(PROCESS_DEFINITION_KEY)
        .singleResult()
        .getId();

    Incident incident = runtimeService.createIncidentQuery()
        .processInstanceId(processInstanceId)
        .singleResult();

    HistoricIncidentQuery query = historyService.createHistoricIncidentQuery()
        .rootCauseIncidentId(incident.getId());

    assertEquals(2, query.list().size());
    assertEquals(2, query.count());
  }
View Full Code Here


  @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/oneFailingServiceProcess.bpmn20.xml"})
  public void testPropertiesOfHistoricIncident() {
    startProcessInstance(PROCESS_DEFINITION_KEY);

    Incident incident = runtimeService.createIncidentQuery().singleResult();
    assertNotNull(incident);

    HistoricIncident historicIncident = historyService.createHistoricIncidentQuery().singleResult();
    assertNotNull(historicIncident);

    assertEquals(incident.getId(), historicIncident.getId());
    assertEquals(incident.getIncidentTimestamp(), historicIncident.getCreateTime());
    assertNull(historicIncident.getEndTime());
    assertEquals(incident.getIncidentType(), historicIncident.getIncidentType());
    assertEquals(incident.getIncidentMessage(), historicIncident.getIncidentMessage());
    assertEquals(incident.getExecutionId(), historicIncident.getExecutionId());
    assertEquals(incident.getActivityId(), historicIncident.getActivityId());
    assertEquals(incident.getProcessInstanceId(), historicIncident.getProcessInstanceId());
    assertEquals(incident.getProcessDefinitionId(), historicIncident.getProcessDefinitionId());
    assertEquals(incident.getCauseIncidentId(), historicIncident.getCauseIncidentId());
    assertEquals(incident.getRootCauseIncidentId(), historicIncident.getRootCauseIncidentId());
    assertEquals(incident.getConfiguration(), historicIncident.getConfiguration());

    assertTrue(historicIncident.isOpen());
    assertFalse(historicIncident.isDeleted());
    assertFalse(historicIncident.isResolved());
  }
View Full Code Here

    executeAvailableJobs();

    List<Incident> incidentList = runtimeService.createIncidentQuery().list();
    assertEquals(1, incidentList.size());

    Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId()).singleResult();

    List<Execution> executionList = runtimeService
        .createExecutionQuery()
        .incidentId(incident.getId()).list();

    assertEquals(1, executionList.size());
  }
View Full Code Here

    executeAvailableJobs();

    List<Incident> incidentList = runtimeService.createIncidentQuery().list();
    assertEquals(1, incidentList.size());

    Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId()).singleResult();

    List<Execution> executionList = runtimeService
        .createExecutionQuery()
        .incidentType(incident.getIncidentType()).list();

    assertEquals(1, executionList.size());
  }
View Full Code Here

    executeAvailableJobs();

    List<Incident> incidentList = runtimeService.createIncidentQuery().list();
    assertEquals(1, incidentList.size());

    Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId()).singleResult();

    List<Execution> executionList = runtimeService
        .createExecutionQuery()
        .incidentMessage(incident.getIncidentMessage()).list();

    assertEquals(1, executionList.size());
  }
View Full Code Here

    executeAvailableJobs();

    List<Incident> incidentList = runtimeService.createIncidentQuery().list();
    assertEquals(1, incidentList.size());

    Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId()).singleResult();

    List<Execution> executionList = runtimeService
        .createExecutionQuery()
        .incidentId(incident.getId()).list();

    assertEquals(1, executionList.size());
    // execution id of subprocess != process instance id
    assertNotSame(processInstance.getId(), executionList.get(0).getId());
  }
View Full Code Here

    executeAvailableJobs();

    List<Incident> incidentList = runtimeService.createIncidentQuery().list();
    assertEquals(1, incidentList.size());

    Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId()).singleResult();

    List<Execution> executionList = runtimeService
        .createExecutionQuery()
        .incidentType(incident.getIncidentType()).list();

    assertEquals(1, executionList.size());
    // execution id of subprocess != process instance id
    assertNotSame(processInstance.getId(), executionList.get(0).getId());
  }
View Full Code Here

    executeAvailableJobs();

    List<Incident> incidentList = runtimeService.createIncidentQuery().list();
    assertEquals(1, incidentList.size());

    Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId()).singleResult();

    List<Execution> executionList = runtimeService
        .createExecutionQuery()
        .incidentMessage(incident.getIncidentMessage()).list();

    assertEquals(1, executionList.size());
    // execution id of subprocess != process instance id
    assertNotSame(processInstance.getId(), executionList.get(0).getId());
  }
View Full Code Here

    assertEquals(0, query.count());

    List<Incident> incidents = query.list();
    assertTrue(incidents.isEmpty());

    Incident incident = query.singleResult();
    assertNull(incident);
  }
View Full Code Here

    assertEquals(0, query.count());

    List<Incident> incidents = query.list();
    assertTrue(incidents.isEmpty());

    Incident incident = query.singleResult();
    assertNull(incident);
  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.runtime.Incident

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.