Skip to content

Commit

Permalink
Revert "Go through the HistoryManager for deleting historic case inst…
Browse files Browse the repository at this point in the history
…ances"

This reverts commit 5834cee.
  • Loading branch information
jbarrez committed Jul 19, 2023
1 parent d952b72 commit 04d5465
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> caseInstanceIds, CmmnEngineConfiguration cmmnEngineConfiguration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -132,8 +131,7 @@ public void deleteCaseDefinitionAndRelatedData(String caseDefinitionId, boolean
List<HistoricCaseInstance> historicCaseInstanceEntities = historicCaseInstanceEntityManager
.findByCriteria(new HistoricCaseInstanceQueryImpl().caseDefinitionId(caseDefinitionId));
for (HistoricCaseInstance historicCaseInstanceEntity : historicCaseInstanceEntities) {
CommandContextUtil.getCmmnHistoryManager(commandContext).recordHistoricCaseInstanceDeleted(historicCaseInstanceEntity.getId(),
historicCaseInstanceEntity.getTenantId());
CmmnHistoryHelper.deleteHistoricCaseInstance(engineConfiguration, historicCaseInstanceEntity.getId());
}
}

Expand Down

0 comments on commit 04d5465

Please sign in to comment.