{"record":{"id":"227dbb553e291ccb","repo":"flowable/flowable-engine","slug":"no-decisions-deployed-with-key-definitionkey","errorCode":null,"errorMessage":"no decisions deployed with key '${definitionKey}'","messagePattern":"no decisions deployed with key '(.+?)'","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/persistence/deploy/DeploymentManager.java","lineNumber":85,"sourceCode":"        // first try the cache\n        DecisionCacheEntry cacheEntry = decisionCache.get(decisionId);\n        DecisionEntity decision = cacheEntry != null ? cacheEntry.getDecisionEntity() : null;\n\n        if (decision == null) {\n            decision = engineConfig.getDecisionEntityManager().findById(decisionId);\n            if (decision == null) {\n                throw new FlowableObjectNotFoundException(\"no decision found with id '\" + decisionId + \"'\");\n            }\n            decision = resolveDecision(decision).getDecisionEntity();\n        }\n        return decision;\n    }\n\n    public DecisionEntity findDeployedLatestDefinitionByKey(String definitionKey) {\n        DecisionEntity definition = decisionEntityManager.findLatestDecisionByKey(definitionKey);\n\n        if (definition == null) {\n            throw new FlowableObjectNotFoundException(\"no decisions deployed with key '\" + definitionKey + \"'\");\n        }\n        definition = resolveDecision(definition).getDecisionEntity();\n        return definition;\n    }\n\n    public DecisionEntity findDeployedLatestDefinitionByKeyAndTenantId(String definitionKey, String tenantId) {\n        DecisionEntity definition = decisionEntityManager.findLatestDecisionByKeyAndTenantId(definitionKey, tenantId);\n\n        if (definition == null) {\n            throw new FlowableObjectNotFoundException(\"no decisions deployed with key '\" + definitionKey + \"' for tenant identifier '\" + tenantId + \"'\");\n        }\n        definition = resolveDecision(definition).getDecisionEntity();\n        return definition;\n    }\n\n    public DecisionEntity findDeployedLatestDecisionByKeyAndDeploymentId(String definitionKey, String deploymentId) {\n        DecisionEntity definition = decisionEntityManager.findDecisionByDeploymentAndKey(deploymentId, definitionKey);\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/persistence/deploy/DeploymentManager.java#L67-L103","documentation":"findDeployedLatestDefinitionByKey throws FlowableObjectNotFoundException when no decision with the given key is deployed at all (findLatestDecisionByKey returns null). The decision key is the logical identifier used by decision tables to reference decisions across versions.","triggerScenarios":"Calling findDeployedLatestDefinitionByKey with a key that has never been deployed, or after all deployments containing that decision were deleted.","commonSituations":"DMN deployment not made in the target environment; decision key renamed in the .dmn XML while the decision table still references the old key; wrong database or tenant setup.","solutions":["List deployed decisions via dmnRepositoryService.createDecisionQuery().list() and confirm the exact key.","Deploy the DMN resource containing the decision before executing the decision table.","Align the decisionTable decision reference key with the key in the .dmn XML (e.g. after a rename/refactor)."],"exampleFix":"// before\nDecisionEntity d = manager.findDeployedLatestDefinitionByKey(\"approveOrder\"); // NPE risk / not found\n// after\nDmnDecision d = dmnRepositoryService.createDecisionQuery().latest().decisionKey(\"approveOrder\").singleResult();\nif (d == null) {\n    dmnRepositoryService.createDeployment().addClasspathResource(\"approveOrder.dmn\").deploy();\n}\nd = manager.findDeployedLatestDefinitionByKey(\"approveOrder\");","handlingStrategy":"validation","validationCode":"boolean keyDeployed = dmnRepositoryService.createDecisionQuery()\n    .latest().decisionKey(decisionKey).count() > 0;","typeGuard":null,"tryCatchPattern":"try { return manager.findDeployedLatestDefinitionByKey(key); } catch (FlowableObjectNotFoundException e) { throw new IllegalStateException(\"DMN for key '\" + key + \"' not deployed — deploy resources first\", e); }","preventionTips":["Make DMN deployment an explicit startup/CI step before rule execution","Grep .dmn files for the decision keys your decision tables reference","Add an integration test that resolves every referenced decision key"],"tags":["flowable-dmn","not-found","missing-deployment","decision-key"],"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-18T11:17:12.947Z"}