{"record":{"id":"6a1bb255edb3cc71","repo":"flowable/flowable-engine","slug":"deploymentid-is-null-6a1bb2","errorCode":null,"errorMessage":"deploymentId is null","messagePattern":"deploymentId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetDeploymentParentDeploymentIdCmd.java","lineNumber":42,"sourceCode":"/**\n * @author Tijs Rademakers\n */\npublic class SetDeploymentParentDeploymentIdCmd implements Command<Void>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n\n    protected String deploymentId;\n    protected String newParentDeploymentId;\n\n    public SetDeploymentParentDeploymentIdCmd(String deploymentId, String newParentDeploymentId) {\n        this.deploymentId = deploymentId;\n        this.newParentDeploymentId = newParentDeploymentId;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentId is null\");\n        }\n\n        // Update all entities\n\n        DeploymentEntity deployment = CommandContextUtil.getDeploymentEntityManager(commandContext).findById(deploymentId);\n        if (deployment == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find deployment with id \" + deploymentId);\n        }\n\n        deployment.setParentDeploymentId(newParentDeploymentId);\n\n        CommandContextUtil.getDeploymentEntityManager(commandContext).update(deployment);\n\n        return null;\n\n    }\n\n}","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetDeploymentParentDeploymentIdCmd.java#L24-L60","documentation":"SetDeploymentParentDeploymentIdCmd.execute throws FlowableIllegalArgumentException when deploymentId is null. The command links a deployment to a parent deployment id and requires a non-null id to load the child DeploymentEntity. Argument-validation guard at the start of execute.","triggerScenarios":"Calling repositoryService.setDeploymentParentDeploymentId(null, newParentDeploymentId) or executing new SetDeploymentParentDeploymentIdCmd(null, parent).","commonSituations":"Child deployment id never assigned; forwarding a null from a failed query result; scripting the parent/child deployment (e.g. app engine deployments) with a missing id.","solutions":["Pass a valid non-null child deployment id.","Null-check the id before invoking, resolving it from a deployment query if needed.","Ensure the deployment was persisted before attempting to set its parent."],"exampleFix":"// before\nrepositoryService.setDeploymentParentDeploymentId(childId, parentId); // childId null\n// after\nif (childId != null) {\n    repositoryService.setDeploymentParentDeploymentId(childId, parentId);\n}","handlingStrategy":"validation","validationCode":"if (deploymentId == null || deploymentId.isEmpty()) {\n    throw new IllegalArgumentException(\"deploymentId is required to set parent deployment\");\n}\nrepositoryService.setDeploymentParentDeploymentId(deploymentId, newParentDeploymentId);","typeGuard":"boolean childIdPresent = deploymentId != null && !deploymentId.isEmpty();","tryCatchPattern":null,"preventionTips":["Persist the deployment first, then use the id from the DeploymentEntity for parent linking.","Null-check both child and parent ids before setting the hierarchy.","Wrap parent/child deployment wiring in helpers that validate all ids up front."],"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"}