From e8a009b3e9351a6ae796eca14983d8525fcbe6a9 Mon Sep 17 00:00:00 2001 From: Joram Barrez Date: Thu, 20 Jul 2023 00:43:49 +0200 Subject: [PATCH] Revert "Go through the HistoryManager for deleting historic case instances" This reverts commit b8f0de3c4ef1de512e7c3edf6f4dcb65488b66ca. --- .../flowable/cmmn/engine/impl/history/CmmnHistoryHelper.java | 2 +- .../persistence/entity/CaseDefinitionEntityManagerImpl.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) 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()); } }