Search in sources :

Example 6 with IncidentHandler

use of org.camunda.bpm.engine.impl.incident.IncidentHandler in project camunda-bpm-platform by camunda.

the class PvmExecutionImpl method createIncident.

public Incident createIncident(String incidentType, String configuration, String message) {
    IncidentContext incidentContext = new IncidentContext();
    incidentContext.setTenantId(this.getTenantId());
    incidentContext.setProcessDefinitionId(this.getProcessDefinitionId());
    incidentContext.setExecutionId(this.getId());
    incidentContext.setActivityId(this.getActivityId());
    incidentContext.setConfiguration(configuration);
    IncidentHandler incidentHandler = findIncidentHandler(incidentType);
    if (incidentHandler == null) {
        incidentHandler = new DefaultIncidentHandler(incidentType);
    }
    return incidentHandler.handleIncident(incidentContext, message);
}
Also used : IncidentHandler(org.camunda.bpm.engine.impl.incident.IncidentHandler) DefaultIncidentHandler(org.camunda.bpm.engine.impl.incident.DefaultIncidentHandler) DefaultIncidentHandler(org.camunda.bpm.engine.impl.incident.DefaultIncidentHandler) IncidentContext(org.camunda.bpm.engine.impl.incident.IncidentContext)

Aggregations

IncidentHandler (org.camunda.bpm.engine.impl.incident.IncidentHandler)6 DefaultIncidentHandler (org.camunda.bpm.engine.impl.incident.DefaultIncidentHandler)3 IncidentContext (org.camunda.bpm.engine.impl.incident.IncidentContext)3 IncidentEntity (org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity)1