Search in sources :

Example 1 with IncidentHandler

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

the class ProcessEngineConfigurationImpl method initIncidentHandlers.

// incident handlers /////////////////////////////////////////////////////////////
protected void initIncidentHandlers() {
    if (incidentHandlers == null) {
        incidentHandlers = new HashMap<String, IncidentHandler>();
        DefaultIncidentHandler failedJobIncidentHandler = new DefaultIncidentHandler(Incident.FAILED_JOB_HANDLER_TYPE);
        incidentHandlers.put(failedJobIncidentHandler.getIncidentHandlerType(), failedJobIncidentHandler);
        DefaultIncidentHandler failedExternalTaskIncidentHandler = new DefaultIncidentHandler(Incident.EXTERNAL_TASK_HANDLER_TYPE);
        incidentHandlers.put(failedExternalTaskIncidentHandler.getIncidentHandlerType(), failedExternalTaskIncidentHandler);
    }
    if (customIncidentHandlers != null) {
        for (IncidentHandler incidentHandler : customIncidentHandlers) {
            incidentHandlers.put(incidentHandler.getIncidentHandlerType(), incidentHandler);
        }
    }
}
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)

Example 2 with IncidentHandler

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

the class ExternalTaskEntity method removeIncident.

protected void removeIncident() {
    IncidentHandler handler = Context.getProcessEngineConfiguration().getIncidentHandler(Incident.EXTERNAL_TASK_HANDLER_TYPE);
    handler.resolveIncident(createIncidentContext());
}
Also used : IncidentHandler(org.camunda.bpm.engine.impl.incident.IncidentHandler)

Example 3 with IncidentHandler

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

the class ExternalTaskEntity method createIncident.

protected void createIncident() {
    IncidentHandler incidentHandler = Context.getProcessEngineConfiguration().getIncidentHandler(Incident.EXTERNAL_TASK_HANDLER_TYPE);
    incidentHandler.handleIncident(createIncidentContext(), errorMessage);
}
Also used : IncidentHandler(org.camunda.bpm.engine.impl.incident.IncidentHandler)

Example 4 with IncidentHandler

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

the class JobEntity method removeFailedJobIncident.

protected void removeFailedJobIncident(boolean incidentResolved) {
    IncidentHandler handler = Context.getProcessEngineConfiguration().getIncidentHandler(Incident.FAILED_JOB_HANDLER_TYPE);
    IncidentContext incidentContext = createIncidentContext();
    if (incidentResolved) {
        handler.resolveIncident(incidentContext);
    } else {
        handler.deleteIncident(incidentContext);
    }
}
Also used : IncidentHandler(org.camunda.bpm.engine.impl.incident.IncidentHandler) IncidentContext(org.camunda.bpm.engine.impl.incident.IncidentContext)

Example 5 with IncidentHandler

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

the class PvmExecutionImpl method resolveIncident.

/**
 * Resolves an incident with given id.
 *
 * @param incidentId
 */
@Override
public void resolveIncident(final String incidentId) {
    IncidentEntity incident = (IncidentEntity) Context.getCommandContext().getIncidentManager().findIncidentById(incidentId);
    IncidentHandler incidentHandler = findIncidentHandler(incident.getIncidentType());
    if (incidentHandler == null) {
        incidentHandler = new DefaultIncidentHandler(incident.getIncidentType());
    }
    IncidentContext incidentContext = new IncidentContext(incident);
    incidentHandler.resolveIncident(incidentContext);
}
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) IncidentEntity(org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity) 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