diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/CmmnHistoryHelper.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/CmmnHistoryHelper.java index 82a4a0cc236..8b12e4d63b9 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/CmmnHistoryHelper.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/CmmnHistoryHelper.java @@ -70,7 +70,7 @@ public static void deleteHistoricCaseInstance(CmmnEngineConfiguration cmmnEngine // Also delete any sub cases that may be active historicCaseInstanceEntityManager.createHistoricCaseInstanceQuery().caseInstanceParentId(caseInstanceId).list() - .forEach(c -> cmmnEngineConfiguration.getCmmnHistoryManager().recordHistoricCaseInstanceDeleted(c.getId(), c.getTenantId())); + .forEach(c -> deleteHistoricCaseInstance(cmmnEngineConfiguration, c.getId())); } public static void bulkDeleteHistoricCaseInstances(Collection caseInstanceIds, CmmnEngineConfiguration cmmnEngineConfiguration) { diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/persistence/entity/CaseDefinitionEntityManagerImpl.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/persistence/entity/CaseDefinitionEntityManagerImpl.java index e95f3a348e9..d3217073068 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/persistence/entity/CaseDefinitionEntityManagerImpl.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/persistence/entity/CaseDefinitionEntityManagerImpl.java @@ -28,7 +28,6 @@ import org.flowable.cmmn.engine.impl.repository.CaseDefinitionQueryImpl; import org.flowable.cmmn.engine.impl.runtime.CaseInstanceQueryImpl; import org.flowable.cmmn.engine.impl.task.TaskHelper; -import org.flowable.cmmn.engine.impl.util.CommandContextUtil; import org.flowable.common.engine.api.scope.ScopeTypes; import org.flowable.common.engine.impl.context.Context; import org.flowable.common.engine.impl.interceptor.CommandContext; @@ -132,8 +131,7 @@ public void deleteCaseDefinitionAndRelatedData(String caseDefinitionId, boolean List historicCaseInstanceEntities = historicCaseInstanceEntityManager .findByCriteria(new HistoricCaseInstanceQueryImpl().caseDefinitionId(caseDefinitionId)); for (HistoricCaseInstance historicCaseInstanceEntity : historicCaseInstanceEntities) { - CommandContextUtil.getCmmnHistoryManager(commandContext).recordHistoricCaseInstanceDeleted(historicCaseInstanceEntity.getId(), - historicCaseInstanceEntity.getTenantId()); + CmmnHistoryHelper.deleteHistoricCaseInstance(engineConfiguration, historicCaseInstanceEntity.getId()); } }