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();
}
}
}
}
Aggregations