{"record":{"id":"ff1571dd97cc53c0","repo":"flowable/flowable-engine","slug":"deployment-id-is-null-ff1571","errorCode":null,"errorMessage":"Deployment id is null","messagePattern":"Deployment id is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/SetDeploymentCategoryCmd.java","lineNumber":39,"sourceCode":"\r\n/**\r\n * @author Tijs Rademakers\r\n */\r\npublic class SetDeploymentCategoryCmd implements Command<Void> {\r\n\r\n    protected String deploymentId;\r\n    protected String category;\r\n\r\n    public SetDeploymentCategoryCmd(String deploymentId, String category) {\r\n        this.deploymentId = deploymentId;\r\n        this.category = category;\r\n    }\r\n\r\n    @Override\r\n    public Void execute(CommandContext commandContext) {\r\n\r\n        if (deploymentId == null) {\r\n            throw new FlowableIllegalArgumentException(\"Deployment id is null\");\r\n        }\r\n\r\n        DmnDeploymentEntity deployment = CommandContextUtil.getDeploymentEntityManager(commandContext).findById(deploymentId);\r\n\r\n        if (deployment == null) {\r\n            throw new FlowableObjectNotFoundException(\"No deployment found for id = '\" + deploymentId + \"'\");\r\n        }\r\n\r\n        // Update category\r\n        deployment.setCategory(category);\r\n        CommandContextUtil.getDeploymentEntityManager(commandContext).update(deployment);\r\n\r\n        return null;\r\n    }\r\n\r\n    public String getDeploymentId() {\r\n        return deploymentId;\r\n    }\r","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/SetDeploymentCategoryCmd.java#L21-L57","documentation":"SetDeploymentCategoryCmd changes the category of a DMN deployment. It validates that deploymentId is non-null, throwing FlowableIllegalArgumentException ('Deployment id is null') when it is not, before attempting any lookup.","triggerScenarios":"Calling dmnRepositoryService.setDeploymentCategory(null, category) or new SetDeploymentCategoryCmd(null, category).","commonSituations":"Passing the result of a nullable deployment query, uninitialized configuration properties holding the deployment id, or variable shadowing leading to an unset id.","solutions":["Provide a non-null deployment id from DmnRepositoryService.createDeploymentQuery() results","Validate the id at the call site before invoking setDeploymentCategory","Trace why the earlier deployment lookup returned null"],"exampleFix":"// before\nrepositoryService.setDeploymentCategory(deploymentId, \"cat\");\n// after\nObjects.requireNonNull(deploymentId, \"deploymentId required\");\nrepositoryService.setDeploymentCategory(deploymentId, \"cat\");","handlingStrategy":"validation","validationCode":"if (deploymentId == null || deploymentId.isEmpty()) {\n    throw new IllegalArgumentException(\"deploymentId required\");\n}","typeGuard":"boolean hasDeploymentId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try {\n    repositoryService.setDeploymentCategory(deploymentId, category);\n} catch (FlowableIllegalArgumentException e) {\n    log.error(\"Null deploymentId\", e);\n    throw new BadRequestException(\"deploymentId required\");\n}","preventionTips":["Persist deployment ids from deployment results immediately","Null-check configuration values that supply deployment ids","Wrap category updates in helper methods that validate arguments"],"tags":["java","flowable-dmn","null-check","validation"],"backgroundTag":"null-argument","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"}