{"record":{"id":"a5167afee8532836","repo":"flowable/flowable-engine","slug":"dmn-decision-with-key-externalref-was-not-execu","errorCode":null,"errorMessage":"DMN decision with key ${externalRef} was not executed. For ${planItemInstanceEntity}","messagePattern":"DMN decision with key (.+?) was not executed\\. For (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/DecisionTaskActivityBehavior.java","lineNumber":114,"sourceCode":"            executeDecisionBuilder.fallbackToDefaultTenant();\r\n        }\r\n\r\n        String sameDeploymentValue = getFieldString(STRING_DECISION_TABLE_SAME_DEPLOYMENT);\r\n        if (sameDeploymentValue != null) {\r\n            if (Boolean.parseBoolean(sameDeploymentValue)) {\r\n                executeDecisionBuilder.parentDeploymentId(\r\n                        CaseDefinitionUtil.getDefinitionDeploymentId(planItemInstanceEntity.getCaseDefinitionId(), cmmnEngineConfiguration));\r\n            }\r\n        } else {\r\n            // backwards compatibility (always apply parent deployment id)\r\n            executeDecisionBuilder\r\n                    .parentDeploymentId(CaseDefinitionUtil.getDefinitionDeploymentId(planItemInstanceEntity.getCaseDefinitionId(), cmmnEngineConfiguration));\r\n        }\r\n\r\n        DecisionExecutionAuditContainer decisionExecutionAuditContainer = executeDecisionBuilder.executeWithAuditTrail();\r\n\r\n        if (decisionExecutionAuditContainer == null) {\r\n            throw new FlowableException(\"DMN decision with key \" + externalRef + \" was not executed. For \" + planItemInstanceEntity);\r\n        }\r\n        \r\n        if (decisionExecutionAuditContainer.isFailed()) {\r\n            throw new FlowableException(\"DMN decision with key \" + externalRef + \" execution failed. For \" + planItemInstanceEntity,\r\n                    decisionExecutionAuditContainer.getException());\r\n        }\r\n\r\n        /* Throw error if there were no rules hit when the flag indicates to do this. */\r\n        String throwErrorFieldValue = getFieldString(EXPRESSION_DECISION_TABLE_THROW_ERROR_FLAG);\r\n        if (decisionExecutionAuditContainer.getDecisionResult().isEmpty() && throwErrorFieldValue != null) {\r\n            if (\"true\".equalsIgnoreCase(throwErrorFieldValue)) {\r\n                throw new FlowableException(\"DMN decision with key \" + externalRef + \" did not hit any rules for the provided input. For \" + planItemInstanceEntity);\r\n            \r\n            } else if (!\"false\".equalsIgnoreCase(throwErrorFieldValue)) {\r\n                Expression expression = CommandContextUtil.getExpressionManager(commandContext).createExpression(throwErrorFieldValue);\r\n                Object expressionValue = expression.getValue(planItemInstanceEntity);\r\n                \r\n                if (expressionValue instanceof Boolean && ((Boolean) expressionValue)) {\r","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/DecisionTaskActivityBehavior.java#L96-L132","documentation":"After building an ExecuteDecisionBuilder with the resolved externalRef, the behavior calls executeWithAuditTrail(). If the DMN service returns a null audit container, the decision was not executed at all and the engine throws this FlowableException. This indicates the DMN engine could not find or run the referenced decision (e.g. it was not deployed) without a more specific error surfacing.","triggerScenarios":"Calling executeWithAuditTrail() on a decision with key externalRef that does not resolve to a deployed DMN decision, causing a null DecisionExecutionAuditContainer to be returned.","commonSituations":"DMN model not deployed or deployed under a different key/tenant; externalRef key typo; running with a parentDeploymentId filter where the DMN decision was not deployed in the same case deployment; decision key changed after a redeploy while old case instances still reference the old key.","solutions":["Deploy the DMN model containing a decision with the exact key referenced by the decision task (ideally in the same deployment as the case so parentDeploymentId resolution works).","Verify the externalRef/decision key spelling against the deployed DMN definition key, including tenant handling.","Check DMN deployment history via DmnRepositoryService to confirm the decision definition exists and is active.","If cases and decisions are deployed independently, ensure version/parentDeploymentId lookup matches your deployment strategy or update the case model."],"exampleFix":"// before: case deployed without DMN model\nrepositoryService.deploy().addClasspathResource(\"myCase.cmmn\").deploy();\n// after: deploy both so parentDeploymentId resolves\nrepositoryService.deploy()\n    .addClasspathResource(\"myCase.cmmn\")\n    .addClasspathResource(\"myDecision.dmn\")\n    .deploy();","handlingStrategy":"validation","validationCode":"DmnDecisionQuery q = dmnRepositoryService.createDecisionQuery().decisionKey(externalRef);\nif (q.count() == 0) {\n    throw new IllegalStateException(\"DMN decision not deployed: \" + externalRef);\n}","typeGuard":null,"tryCatchPattern":"try {\n    executeDecisionBuilder.executeWithAuditTrail();\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"was not executed\")) {\n        log.error(\"DMN decision {} missing in deployment {}\", externalRef, deploymentId);\n    }\n    throw e;\n}","preventionTips":["Deploy .dmn resources in the same deployment as the .cmmn case model","Verify decision keys between case and DMN models in build-time tests","Check DmnRepositoryService for the definition before starting dependent cases"],"tags":["cmmn","dmn","deployment","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}