{"record":{"id":"e045dc01b442fcd7","repo":"flowable/flowable-engine","slug":"the-decision-id-is-mandatory-but-decisionid-h","errorCode":null,"errorMessage":"The decision id is mandatory, but '<decisionId>' has been provided.","messagePattern":"The decision id is mandatory, but '<decisionId>' has been provided\\.","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/GetDeploymentDecisionRequirementsDiagramCmd.java","lineNumber":39,"sourceCode":"import org.flowable.common.engine.impl.interceptor.CommandContext;\nimport org.flowable.dmn.engine.impl.persistence.entity.DecisionEntity;\nimport org.flowable.dmn.engine.impl.util.CommandContextUtil;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n/**\n * @author Yvo Swillens\n */\npublic class GetDeploymentDecisionRequirementsDiagramCmd implements Command<InputStream>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    private static final Logger LOGGER = LoggerFactory.getLogger(GetDeploymentDecisionRequirementsDiagramCmd.class);\n\n    protected String decisionId;\n\n    public GetDeploymentDecisionRequirementsDiagramCmd(String decisionId) {\n        if (decisionId == null || decisionId.length() == 0) {\n            throw new FlowableIllegalArgumentException(\"The decision id is mandatory, but '\" + decisionId + \"' has been provided.\");\n        }\n        this.decisionId = decisionId;\n    }\n\n    @Override\n    public InputStream execute(CommandContext commandContext) {\n        DecisionEntity decisionEntity = CommandContextUtil.getDmnEngineConfiguration(commandContext).getDeploymentManager().findDeployedDecisionById(decisionId);\n        String deploymentId = decisionEntity.getDeploymentId();\n        String resourceName = decisionEntity.getDiagramResourceName();\n        if (resourceName == null) {\n            LOGGER.info(\"Resource name is null! No decision requirements diagram stream exists.\");\n            return null;\n        } else {\n            return new GetDeploymentResourceCmd(deploymentId, resourceName).execute(commandContext);\n        }\n    }\n}","sourceCodeStart":21,"sourceCodeEnd":56,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/GetDeploymentDecisionRequirementsDiagramCmd.java#L21-L56","documentation":"The GetDeploymentDecisionRequirementsDiagramCmd constructor validates that the DRD (decision requirements) id is present, throwing FlowableIllegalArgumentException when it is null or empty. The message intentionally includes the blank value that was supplied. This check happens at command construction time, before any command is executed against the repository.","triggerScenarios":"new GetDeploymentDecisionRequirementsDiagramCmd(null) or new GetDeploymentDecisionRequirementsDiagramCmd(\"\") — typically via dmnRepositoryService.getDecisionRequirementsDiagram(id) with a null/empty id.","commonSituations":"Result of a DB/entity lookup that returned null and was passed straight through; an empty request path/id parameter in a REST controller; calling the wrong *Diagram method with a decision-table id left blank.","solutions":["Pass a valid, non-empty decision requirements definition id obtained from the repository query (e.g. DecisionRequirementsDefinition.getId())","Validate the id on the caller side before constructing the command / calling the service","Check upstream data: if the id came from a search result, confirm the DRD was actually deployed and the query matched"],"exampleFix":"// before\nInputStream diagram = repoService.getDecisionRequirementsDiagram(req.getParameter(\"drdId\"));\n// after\nString drdId = req.getParameter(\"drdId\");\nif (drdId == null || drdId.isEmpty()) {\n    throw new BadRequestException(\"drdId is required\");\n}\nInputStream diagram = repoService.getDecisionRequirementsDiagram(drdId);","handlingStrategy":"validation","validationCode":"if (drdId == null || drdId.isEmpty()) throw new IllegalArgumentException(\"decision requirements id is required\");","typeGuard":null,"tryCatchPattern":"try { repoService.getDecisionRequirementsDiagram(id); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().startsWith(\"The decision id is mandatory\")) { return ResponseEntity.badRequest().body(\"drdId required\"); } throw e; }","preventionTips":["Resolve ids from repository queries rather than client-supplied strings where possible","Validate path/parameter ids in the REST layer before calling repository services","Never pass through results of potentially-null lookups without a check"],"tags":["flowable","dmn","drd","empty-required-field"],"backgroundTag":"empty-required-field","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"}