From 39d2fc0a0d8fba06ec958024870eeb3e90c7bd3b Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Singh Date: Wed, 20 Sep 2023 20:19:09 +0530 Subject: [PATCH] Added condition check for enabled entity link before deleting (#3746) * Added condition check for enabled entity link before deleting * Update modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteRelatedDataOfRemovedHistoricCaseInstancesCmd.java Co-authored-by: David B Malkovsky --------- Co-authored-by: Shubhendu Co-authored-by: Filip Hrisafov Co-authored-by: David B Malkovsky --- ...eleteRelatedDataOfRemovedHistoricCaseInstancesCmd.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteRelatedDataOfRemovedHistoricCaseInstancesCmd.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteRelatedDataOfRemovedHistoricCaseInstancesCmd.java index 0ea5682db0e..1f267bd6065 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteRelatedDataOfRemovedHistoricCaseInstancesCmd.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteRelatedDataOfRemovedHistoricCaseInstancesCmd.java @@ -37,9 +37,11 @@ public Object execute(CommandContext commandContext) { IdentityLinkServiceConfiguration identityLinkServiceConfiguration = cmmnEngineConfiguration.getIdentityLinkServiceConfiguration(); identityLinkServiceConfiguration.getHistoricIdentityLinkService().deleteHistoricCaseIdentityLinksForNonExistingInstances(); identityLinkServiceConfiguration.getHistoricIdentityLinkService().deleteHistoricTaskIdentityLinksForNonExistingInstances(); - HistoricEntityLinkService historicEntityLinkService = cmmnEngineConfiguration.getEntityLinkServiceConfiguration().getHistoricEntityLinkService(); - if (historicEntityLinkService != null) { - historicEntityLinkService.deleteHistoricEntityLinksForNonExistingCaseInstances(); + if (cmmnEngineConfiguration.isEnableEntityLinks()) { + HistoricEntityLinkService historicEntityLinkService = cmmnEngineConfiguration.getEntityLinkServiceConfiguration().getHistoricEntityLinkService(); + if (historicEntityLinkService != null) { + historicEntityLinkService.deleteHistoricEntityLinksForNonExistingCaseInstances(); + } } cmmnEngineConfiguration.getTaskServiceConfiguration().getHistoricTaskService().deleteHistoricTaskLogEntriesForNonExistingCaseInstances(); cmmnEngineConfiguration.getVariableServiceConfiguration().getHistoricVariableService().deleteHistoricVariableInstancesForNonExistingCaseInstances();