{"record":{"id":"e33543a14b824ef6","repo":"flowable/flowable-engine","slug":"deployment-id-is-null-e33543","errorCode":null,"errorMessage":"Deployment id is null","messagePattern":"Deployment id is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetDeploymentCategoryCmd.java","lineNumber":45,"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        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\r\n        DeploymentEntity deployment = processEngineConfiguration.getDeploymentEntityManager().findById(deploymentId);\r\n\r\n        if (deployment == null) {\r\n            throw new FlowableObjectNotFoundException(\"No deployment found for id = '\" + deploymentId + \"'\", Deployment.class);\r\n        }\r\n\r\n        if (Flowable5Util.isFlowable5Deployment(deployment, commandContext)) {\r\n            processEngineConfiguration.getFlowable5CompatibilityHandler().setDeploymentCategory(deploymentId, category);\r\n        }\r\n\r\n        // Update category\r\n        deployment.setCategory(category);\r\n\r\n        FlowableEventDispatcher eventDispatcher = processEngineConfiguration.getEventDispatcher();\r\n        if (eventDispatcher != null && eventDispatcher.isEnabled()) {\r","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetDeploymentCategoryCmd.java#L27-L63","documentation":"SetDeploymentCategoryCmd.execute throws FlowableIllegalArgumentException when deploymentId is null. The command needs the id to load the DeploymentEntity whose category will be changed. Pure argument-validation guard before any entity lookup.","triggerScenarios":"Calling repositoryService.setDeploymentCategory(null, category) or executing new SetDeploymentCategoryCmd(null, category).","commonSituations":"The deployment id variable was never assigned; forwarding the result of a failed lookup; building the command programmatically with an unset field.","solutions":["Pass a valid deployment id string obtained from repositoryService.createDeploymentQuery() results.","Check the id for null/blank before calling the API.","Confirm the deployment actually completed so a real id exists."],"exampleFix":"// before\nrepositoryService.setDeploymentCategory(deployId, \"myCategory\"); // deployId null\n// after\nif (deployId != null && !deployId.isEmpty()) {\n    repositoryService.setDeploymentCategory(deployId, \"myCategory\");\n}","handlingStrategy":"validation","validationCode":"if (deploymentId == null || deploymentId.isEmpty()) {\n    throw new IllegalArgumentException(\"deploymentId must be provided\");\n}\nrepositoryService.setDeploymentCategory(deploymentId, category);","typeGuard":"boolean isValidId = id != null && !id.trim().isEmpty();","tryCatchPattern":null,"preventionTips":["Obtain deployment ids directly from Deployment objects returned by the deploy() call.","Validate id parameters in wrapper/service layers before touching the repository API.","Avoid stringly-typed id passing between subsystems without checks."],"tags":["flowable","null-argument","deployment","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-14T05:17:10.506Z"}