HistoryLevel historyLevel = processEngineConfiguration.getHistoryLevel();
if(historyLevel.isHistoryEventProduced(eventType, this)) {
final HistoryEventProducer eventProducer = processEngineConfiguration.getHistoryEventProducer();
final HistoryEventHandler eventHandler = processEngineConfiguration.getHistoryEventHandler();
HistoryEvent event = null;
if (HistoryEvent.INCIDENT_CREATE.equals(eventType.getEventName())) {
event = eventProducer.createHistoricIncidentCreateEvt(this);
} else if (HistoryEvent.INCIDENT_RESOLVE.equals(eventType.getEventName())) {
event = eventProducer.createHistoricIncidentResolveEvt(this);
} else if (HistoryEvent.INCIDENT_DELETE.equals(eventType.getEventName())) {
event = eventProducer.createHistoricIncidentDeleteEvt(this);
} else {
return;
}
eventHandler.handleEvent(event);
}
}