Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-13205

If DMN is disabled ACT_RE_DECISION_REQ_DEF is accessed but not created

    • Icon: Bug Report Bug Report
    • Resolution: Fixed
    • Icon: L3 - Default L3 - Default
    • 7.16.0, 7.16.0-alpha2
    • 7.13.0
    • engine
    • None

      Environment (Required on creation):

      Camunda Engine 7.13+

      Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

      If DMN is disabled Camunda will not create the related tables, including ACT_RE_DECISION_REQ_DEF. However, on undeploying a process application the table will still be accessed by DeploymentCache.removeDeployment (last line):

      public void removeDeployment(String deploymentId) {
        bpmnModelInstanceCache.removeAllDefinitionsByDeploymentId(deploymentId);
        if(Context.getProcessEngineConfiguration().isCmmnEnabled()) {
          cmmnModelInstanceCache.removeAllDefinitionsByDeploymentId(deploymentId);
        }
        if(Context.getProcessEngineConfiguration().isDmnEnabled()) {
          dmnModelInstanceCache.removeAllDefinitionsByDeploymentId(deploymentId);
        }
        removeAllDecisionRequirementsDefinitionsByDeploymentId(deploymentId);
      }
      

      Steps to reproduce (Required on creation):

      With a fresh DB disable DMN using `config.setDmnEnabled(false)` and then deploy and undeploy a process application.

      Observed Behavior (Required on creation):

      An exception is thrown because the table ACT_RE_DECISION_REQ_DEF does not exist.

      Expected behavior (Required on creation):

      No DMN tables are accessed when DMN is disabled.

      Root Cause (Required on prioritization):

      -

      Solution Ideas (Optional):

      The call to removeAllDecisionRequirementsDefinitionsByDeploymentId(..) should be moved up inside the `if (...isDmnEnabled())`.

      Hints (Optional):

      -

        This is the controller panel for Smart Panels app

            [CAM-13205] If DMN is disabled ACT_RE_DECISION_REQ_DEF is accessed but not created

            I've created a pull request to reproduce and fix this issue: https://github.com/camunda/camunda-bpm-platform/pull/1365

            Marcus Klimstra added a comment - I've created a pull request to reproduce and fix this issue: https://github.com/camunda/camunda-bpm-platform/pull/1365

            Marcus Klimstra added a comment - - edited

            When working on this I noticed some other things:

            • TestApplicationWithoutProcesses declares a deploymentDescriptor called "deployment-without-processes.xml", but that file doesn't actually exist.
            • ModelInstanceCache is generic with implementations for BPMN, CMMN and DMN, but several methods specifically contain "Bpmn" in the name, which is a bit confusing.
            • There was a bug in CmmnModelInstanceCache: getAllDefinitionsForDeployment returned DMN instead of CMMN definitions. I fixed this is the pull request as well. However...
            • CMMN definitions were still removed from the cache, despite this bug! How is that possible? I did some debugging. As it turns out, the cache is also cleaned through DeploymentManager.deleteCaseDeployment (and deleteDecisionDeployment / deleteDecisionRequirementDeployment for DMN with the correct condition), called by deleteDeployment. This would suggest that DeploymentCache.removeDeployment is superfluous!

            Marcus Klimstra added a comment - - edited When working on this I noticed some other things: TestApplicationWithoutProcesses declares a deploymentDescriptor called "deployment-without-processes.xml", but that file doesn't actually exist. ModelInstanceCache is generic with implementations for BPMN, CMMN and DMN, but several methods specifically contain "Bpmn" in the name, which is a bit confusing. There was a bug in CmmnModelInstanceCache: getAllDefinitionsForDeployment returned DMN instead of CMMN definitions. I fixed this is the pull request as well. However... CMMN definitions were still removed from the cache, despite this bug! How is that possible? I did some debugging. As it turns out, the cache is also cleaned through DeploymentManager.deleteCaseDeployment (and deleteDecisionDeployment / deleteDecisionRequirementDeployment for DMN with the correct condition), called by deleteDeployment. This would suggest that DeploymentCache.removeDeployment is superfluous!

            I've updated the pull request (https://github.com/camunda/camunda-bpm-platform/pull/1365) and added clarification on how the different changes are related.

            Marcus Klimstra added a comment - I've updated the pull request ( https://github.com/camunda/camunda-bpm-platform/pull/1365 ) and added clarification on how the different changes are related.

            Hi marcusk,

            Thanks! I will review them asap and provide you with feedback.

            Cheers,
            Nikola

            Nikola Koevski added a comment - Hi marcusk , Thanks! I will review them asap and provide you with feedback. Cheers, Nikola

              Unassigned Unassigned
              marcusk Marcus Klimstra
              Nikola Koevski Nikola Koevski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: