{"record":{"id":"c154f438c789307b","repo":"flowable/flowable-engine","slug":"dmn-decision-with-key-externalref-did-not-hit-a","errorCode":null,"errorMessage":"DMN decision with key ${externalRef} did not hit any rules for the provided input. For ${planItemInstanceEntity}","messagePattern":"DMN decision with key (.+?) did not hit any rules for the provided input\\. 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":126,"sourceCode":"                    .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\n                    throw new FlowableException(\"DMN decision with key \" + externalRef + \" did not hit any rules for the provided input. For \" + planItemInstanceEntity);\r\n                }\r\n            }\r\n        }\r\n\r\n        if (cmmnEngineConfiguration.getDecisionTableVariableManager() != null) {\r\n            if (decisionExecutionAuditContainer instanceof DecisionServiceExecutionAuditContainer decisionServiceExecutionAuditContainer) {\r\n                cmmnEngineConfiguration.getDecisionTableVariableManager().setDecisionServiceVariablesOnPlanItemInstance(decisionServiceExecutionAuditContainer.getDecisionServiceResult(),\r\n                    externalRef, planItemInstanceEntity, cmmnEngineConfiguration.getObjectMapper(), decisionExecutionAuditContainer.isMultipleResults());\r\n            } else {\r\n                cmmnEngineConfiguration.getDecisionTableVariableManager().setVariablesOnPlanItemInstance(decisionExecutionAuditContainer.getDecisionResult(),\r\n                    externalRef, planItemInstanceEntity, cmmnEngineConfiguration.getObjectMapper(), decisionExecutionAuditContainer.isMultipleResults());\r","sourceCodeStart":108,"sourceCodeEnd":144,"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#L108-L144","documentation":"When a decision table executes successfully but matches no rules, the result is empty. If the decision table's throw-error flag (fallthrough/error field) is the literal string 'true', the engine treats 'no rules hit' as an error and throws this FlowableException. This is an explicit model-driven configuration, not an engine malfunction.","triggerScenarios":"decisionExecutionAuditContainer.getDecisionResult().isEmpty() and getFieldString(EXPRESSION_DECISION_TABLE_THROW_ERROR_FLAG) equals 'true' (case-insensitive).","commonSituations":"Decision table hit policy/input conditions too strict so no row matches, combined with the throw-error flag set to true; input values outside expected ranges (e.g. amount null or negative) so no rule fires.","solutions":["Add a catch-all/default rule row to the decision table that matches any input and produces a default output.","Loosen the input conditions or add rules covering the actual input values seen in production.","If empty results are acceptable, remove the throw-error field or set it to 'false' in the decision task configuration.","Handle FlowableException around case execution and route the case to a compensation/error plan item."],"exampleFix":"<!-- before: no default rule, throw error enabled -->\n<decisionTable throw=\"true\"> ... rows only for amount &gt; 0 ... </decisionTable>\n<!-- after: acceptable empty result -->\n<decisionTable throw=\"false\"> ... </decisionTable>\n<!-- or add a default rule row matching all inputs -->","handlingStrategy":"try-catch","validationCode":"// none: emptiness of decision result is only knowable after execution","typeGuard":null,"tryCatchPattern":"try {\n    caseRuntimeService.triggerPlanItemInstance(planItemId);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"did not hit any rules\")) {\n        // route to manual review plan item\n    } else {\n        throw e;\n    }\n}","preventionTips":["Add a default/catch-all rule row to decision tables with throw=true","Only set the throw-error flag when empty results are genuinely invalid","Test decision tables with boundary input values (null, zero, negatives)"],"tags":["cmmn","dmn","decision-table","empty-result"],"backgroundTag":"empty-result-set","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"}