{"record":{"id":"06eba4f7ce5fdf94","repo":"flowable/flowable-engine","slug":"no-decisions-deployed-with-key-definitionkey-06eba4","errorCode":null,"errorMessage":"no decisions deployed with key '${definitionKey}' for deployment id '${deploymentId}'","messagePattern":"no decisions deployed with key '(.+?)' for deployment id '(.+?)'","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":105,"sourceCode":"        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\n        if (definition == null) {\n            throw new FlowableObjectNotFoundException(\"no decisions deployed with key '\" + definitionKey +\n                            \"' for deployment id '\" + deploymentId + \"'\");\n        }\n        definition = resolveDecision(definition).getDecisionEntity();\n        return definition;\n    }\n\n    public DecisionEntity findDeployedLatestDecisionByKeyDeploymentIdAndTenantId(String definitionKey,\n            String deploymentId, String tenantId) {\n        DecisionEntity definition = decisionEntityManager.findDecisionByDeploymentAndKeyAndTenantId(deploymentId, definitionKey, tenantId);\n\n        if (definition == null) {\n            throw new FlowableObjectNotFoundException(\"no decisions deployed with key '\" + definitionKey +\n                            \"' for deployment id '\" + deploymentId + \"' and tenant identifier \" + tenantId);\n        }\n        definition = resolveDecision(definition).getDecisionEntity();\n        return definition;\n    }\n","sourceCodeStart":87,"sourceCodeEnd":123,"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#L87-L123","documentation":"findDeployedLatestDecisionByKeyAndDeploymentId throws FlowableObjectNotFoundException when the given deployment does not contain a decision with the given key (findDecisionByDeploymentAndKey returns null). This pins the lookup to one specific deployment's version of the decision.","triggerScenarios":"Calling findDeployedLatestDecisionByKeyAndDeploymentId with a deploymentId that doesn't include the decision, or a key that wasn't part of that deployment.","commonSituations":"Mixing deployment ids across environments; the .dmn file with that key was removed in a later deployment; key renamed inside the deployed resource while callers still use the old key.","solutions":["Confirm the decision is in that deployment: createDecisionQuery().deploymentId(id).decisionKey(key).list().","Use the correct deploymentId that actually contains the decision, or fall back to findDeployedLatestDefinitionByKey for the latest across deployments.","Redeploy the DMN resource with the expected key into that deployment."],"exampleFix":"// before\nDecisionEntity d = manager.findDeployedLatestDecisionByKeyAndDeploymentId(\"approveOrder\", wrongDeploymentId);\n// after\nif (dmnRepositoryService.createDecisionQuery().deploymentId(deploymentId).decisionKey(\"approveOrder\").count() == 0) {\n    throw new FlowableObjectNotFoundException(\"decision not in deployment \" + deploymentId);\n}\nDecisionEntity d = manager.findDeployedLatestDecisionByKeyAndDeploymentId(\"approveOrder\", deploymentId);","handlingStrategy":"validation","validationCode":"boolean inDeployment = dmnRepositoryService.createDecisionQuery()\n    .deploymentId(deploymentId).decisionKey(key).count() > 0;","typeGuard":null,"tryCatchPattern":"try { return manager.findDeployedLatestDecisionByKeyAndDeploymentId(key, deploymentId); } catch (FlowableObjectNotFoundException e) { return manager.findDeployedLatestDefinitionByKey(key); /* fallback */ }","preventionTips":["Capture the deploymentId returned at deploy time and store it with the referencing config","Don't assume a key exists in every deployment","Prefer latest-by-key lookups unless strict deployment pinning is required"],"tags":["flowable-dmn","not-found","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"}