{"record":{"id":"5838ab280d3895c0","repo":"flowable/flowable-engine","slug":"required-decision-decisionid-is-not-available","errorCode":null,"errorMessage":"Required decision <decisionId> is not available","messagePattern":"Required decision <decisionId> is not available","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/agenda/operation/ExecuteDecisionServiceOperation.java","lineNumber":105,"sourceCode":"            if (sortDecision.getRequiredDecisions().isEmpty()) {\n                sortDecisions.addFirst(sortDecision);\n            } else {\n                sortDecisions.addLast(sortDecision);\n            }\n        }\n\n        for (Decision decision : sortDecisions) {\n            if (!visited.get(decision.getId())) {\n                executeSort(decisionsById, decision.getId(), visited, order);\n            }\n        }\n\n        return order;\n    }\n\n    private void executeSort(Map<String, Decision> decisions, String decisionId, Map<String, Boolean> visited, List<Decision> order) {\n        if (!decisions.containsKey(decisionId)) {\n            throw new FlowableObjectNotFoundException(\"Required decision \" + decisionId + \" is not available\");\n        }\n\n        // Mark the current node as visited\n        visited.replace(decisionId, true);\n\n        // We reuse the algorithm on all adjacent nodes to the current node\n        for (InformationRequirement requiredDecision : decisions.get(decisionId).getRequiredDecisions()) {\n            if (!visited.get(requiredDecision.getRequiredDecision().getParsedId())) {\n                executeSort(decisions, requiredDecision.getRequiredDecision().getParsedId(), visited, order);\n            }\n        }\n\n        // Put the current node in the array\n        order.add(decisions.get(decisionId));\n    }\n}\n","sourceCodeStart":87,"sourceCodeEnd":122,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/agenda/operation/ExecuteDecisionServiceOperation.java#L87-L122","documentation":"When executing a decision service, Flowable topologically sorts required decisions to determine execution order. If a decision referenced (via required decisions/decision dependencies) is not among the decisions in the current deployment/scope, a FlowableObjectNotFoundException is thrown.","triggerScenarios":"executeSort visits decisionId while computing the execution order and decisions map (built from the deployment's decisions for this decision service) does not contain that key.","commonSituations":"A DMN deployment is missing one of the decisions referenced by the decision service's required decisions; deploying a partial set of DMN resources; renaming decision ids after they were cross-referenced; case/tenant-specific deployments lacking a dependency.","solutions":["Ensure all DMN files referenced as required decisions are in the same deployment","Check the decision id strings referenced by the decision service match actual decision ids (case-sensitive)","Redeploy the complete DMN artifact set for that tenant","Inspect the decision service's requiredDecisions in the DMN XML to enumerate missing keys"],"exampleFix":"// before\n<decisionService>... requires decision 'risk-score' but only 'fraud-check' deployed\n// after\ndeploy both decisions dmn files in the repository before executing the decision service","handlingStrategy":"try-catch","validationCode":"for (String requiredId : decisionServiceInfo.getRequiredDecisions()) {\n  if (repositoryService.createDecisionQuery().decisionKey(requiredId).list().isEmpty()) {\n    throw new IllegalStateException(\"required decision not deployed: \" + requiredId);\n  }\n}","typeGuard":null,"tryCatchPattern":"try { dmnEngine.executeDecisionServiceByKey(serviceKey, vars); }\ncatch (FlowableObjectNotFoundException e) {\n  LOG.error(\"missing required decision in deployment: {}\", e.getMessage());\n  // redeploy full DMN artifact set\n}","preventionTips":["Deploy all DMN resources of a decision service in one deployment","Keep decision ids stable across deployments","Verify referenced decision ids after refactors/renames"],"tags":["dmn","deployment","not-found","flowable"],"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"}