{"record":{"id":"47f02c06d3eb1506","repo":"flowable/flowable-engine","slug":"provided-decision-definition-must-have-its-resourc","errorCode":null,"errorMessage":"Provided decision definition must have its resource name set.","messagePattern":"Provided decision definition must have its resource name set\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/deployer/ResourceNameUtil.java","lineNumber":52,"sourceCode":"        }\n        return dmnFileResource;\n    }\n\n    public static String getDecisionRequirementsDiagramResourceName(String dmnFileResource, String decisionKey, String diagramSuffix) {\n        String dmnFileResourceBase = stripDmnFileSuffix(dmnFileResource);\n        return dmnFileResourceBase + decisionKey + \".\" + diagramSuffix;\n    }\n\n    /**\n     * Finds the name of a resource for the diagram for a decision definition. Assumes that the decision definition's key and (DMN) resource name are already set.\n     *\n     * @return name of an existing resource, or null if no matching image resource is found in the resources.\n     */\n    public static String getDecisionRequirementsDiagramResourceNameFromDeployment(\n            DecisionEntity decisionDefinition, Map<String, EngineResource> resources) {\n\n        if (StringUtils.isEmpty(decisionDefinition.getResourceName())) {\n            throw new IllegalStateException(\"Provided decision definition must have its resource name set.\");\n        }\n\n        String dmnResourceBase = stripDmnFileSuffix(decisionDefinition.getResourceName());\n        String key = decisionDefinition.getKey();\n\n        for (String diagramSuffix : DIAGRAM_SUFFIXES) {\n            String possibleName = dmnResourceBase + key + \".\" + diagramSuffix;\n            if (resources.containsKey(possibleName)) {\n                return possibleName;\n            }\n\n            possibleName = dmnResourceBase + diagramSuffix;\n            if (resources.containsKey(possibleName)) {\n                return possibleName;\n            }\n        }\n\n        return null;","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/deployer/ResourceNameUtil.java#L34-L70","documentation":"ResourceNameUtil.getDecisionRequirementsDiagramResourceNameFromDeployment derives a diagram resource name by stripping the DMN file suffix from the decision's resourceName; without a resource name it cannot form the base name and throws IllegalStateException. Like error 1333 this is an internal invariant enforced before diagram-resource lookup.","triggerScenarios":"Diagram-resource lookup during deployment when the DecisionEntity's resourceName is empty — usually the same root cause as missing key: malformed DMN XML or a custom parse handler that never set resourceName.","commonSituations":"Custom deployers interfering with resource assignment; decisions built programmatically; DMN resources deployed through a nonstandard path that bypasses resource-name population.","solutions":["Ensure each decision's resourceName is set to its source .dmn resource during parsing/deployment.","Fix the DMN XML/resource wiring so decisions map to a real deployed resource.","Guard custom code with StringUtils.isNotEmpty(decision.getResourceName()) before calling diagram helpers.","Disable diagram generation (DMN create diagram setting) if diagrams are not needed and resources are incomplete."],"exampleFix":"// before\nString diagramResource = ResourceNameUtil.getDecisionRequirementsDiagramResourceNameFromDeployment(decision, resources);\n// after\nif (StringUtils.isNotEmpty(decision.getResourceName())) {\n    String diagramResource = ResourceNameUtil.getDecisionRequirementsDiagramResourceNameFromDeployment(decision, resources);\n}","handlingStrategy":"validation","validationCode":"if (StringUtils.isEmpty(decisionDefinition.getResourceName())) {\n    throw new IllegalStateException(\"Decision resource name missing; cannot resolve diagram resource\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    String name = ResourceNameUtil.getDecisionRequirementsDiagramResourceNameFromDeployment(decision, resources);\n} catch (IllegalStateException e) {\n    name = null; // no diagram resolution possible\n}","preventionTips":["Ensure decisions carry their source resource name after parsing","Validate DMN resources pre-deploy","Disable diagram generation when resources are incomplete"],"tags":["flowable","dmn","invariant","resource-name","diagram"],"backgroundTag":"internal-invariant-violation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}