{"record":{"id":"1700839eab73ae92","repo":"flowable/flowable-engine","slug":"deploymentid-is-null-170083","errorCode":null,"errorMessage":"deploymentId is null","messagePattern":"deploymentId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/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        EventDeploymentEntity 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-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/SetDeploymentParentDeploymentIdCmd.java#L24-L60","documentation":"SetDeploymentParentDeploymentIdCmd.execute() first validates that deploymentId is non-null and throws FlowableIllegalArgumentException otherwise. This command re-parents an event deployment (used for parent/child deployment linkage), which is impossible without an id.","triggerScenarios":"Calling setDeploymentParentDeploymentId with a null deployment id, e.g. from an empty query result or an unset variable passed through the API.","commonSituations":"Automated deployment scripts where the deployment step was skipped or failed, leaving the id unset; misordered pipeline steps consuming an id before it is created.","solutions":["Resolve the deployment id via a deployment query before invoking the command.","Add a null check / assertion in the calling code with a descriptive error.","Fix the pipeline so deployment creation completes and its id is propagated before re-parenting."],"exampleFix":"// before\neventRepositoryService.setDeploymentParentDeploymentId(deployId, parentDeployId); // deployId is null\n// after\nObjects.requireNonNull(deployId, \"deployId must be resolved from deployment response before re-parenting\");\neventRepositoryService.setDeploymentParentDeploymentId(deployId, parentDeployId);","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(deploymentId, \"deploymentId required for setDeploymentParentDeploymentId\");\nObjects.requireNonNull(newParentDeploymentId, \"newParentDeploymentId required\");","typeGuard":"boolean canReparent(String childId, String parentId) {\n    return childId != null && !childId.isBlank() && parentId != null;\n}","tryCatchPattern":"try {\n    eventRepositoryService.setDeploymentParentDeploymentId(deploymentId, newParentDeploymentId);\n} catch (FlowableIllegalArgumentException e) {\n    log.error(\"Null deployment id; check pipeline id propagation\", e);\n}","preventionTips":["Assert ids are non-null at pipeline stage boundaries.","Make deploy steps fail loudly so downstream stages never get null ids.","Prefer explicit id variables over placeholder strings in scripts."],"tags":["flowable","event-registry","null-argument","deployment"],"backgroundTag":"null-argument","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"}