Search in sources :

Example 1 with HistoricDetailEventEntity

use of org.camunda.bpm.engine.impl.history.event.HistoricDetailEventEntity in project camunda-bpm-platform by camunda.

the class HistoricDetailManager method deleteHistoricDetailsByTaskId.

public void deleteHistoricDetailsByTaskId(String taskId) {
    if (isHistoryEnabled()) {
        // delete entries in DB
        List<HistoricDetail> historicDetails = findHistoricDetailsByTaskId(taskId);
        for (HistoricDetail historicDetail : historicDetails) {
            ((HistoricDetailEventEntity) historicDetail).delete();
        }
        // delete entries in Cache
        List<HistoricDetailEventEntity> cachedHistoricDetails = getDbEntityManager().getCachedEntitiesByType(HistoricDetailEventEntity.class);
        for (HistoricDetailEventEntity historicDetail : cachedHistoricDetails) {
            // make sure we only delete the right ones (as we cannot make a proper query in the cache)
            if (taskId.equals(historicDetail.getTaskId())) {
                historicDetail.delete();
            }
        }
    }
}
Also used : HistoricDetail(org.camunda.bpm.engine.history.HistoricDetail) HistoricDetailEventEntity(org.camunda.bpm.engine.impl.history.event.HistoricDetailEventEntity)

Aggregations

HistoricDetail (org.camunda.bpm.engine.history.HistoricDetail)1 HistoricDetailEventEntity (org.camunda.bpm.engine.impl.history.event.HistoricDetailEventEntity)1