flowable/flowable-engine · error · FlowableIllegalArgumentException

deploymentId is null

Error message

deploymentId is null

What it means

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.

Source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetDeploymentParentDeploymentIdCmd.java:42

/**
 * @author Tijs Rademakers
 */
public class SetDeploymentParentDeploymentIdCmd implements Command<Void>, Serializable {

    private static final long serialVersionUID = 1L;

    protected String deploymentId;
    protected String newParentDeploymentId;

    public SetDeploymentParentDeploymentIdCmd(String deploymentId, String newParentDeploymentId) {
        this.deploymentId = deploymentId;
        this.newParentDeploymentId = newParentDeploymentId;
    }

    @Override
    public Void execute(CommandContext commandContext) {
        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("deploymentId is null");
        }

        // Update all entities

        DeploymentEntity deployment = CommandContextUtil.getDeploymentEntityManager(commandContext).findById(deploymentId);
        if (deployment == null) {
            throw new FlowableObjectNotFoundException("Could not find deployment with id " + deploymentId);
        }

        deployment.setParentDeploymentId(newParentDeploymentId);

        CommandContextUtil.getDeploymentEntityManager(commandContext).update(deployment);

        return null;

    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass a valid non-null child deployment id.
  2. Null-check the id before invoking, resolving it from a deployment query if needed.
  3. Ensure the deployment was persisted before attempting to set its parent.

Example fix

// before
repositoryService.setDeploymentParentDeploymentId(childId, parentId); // childId null
// after
if (childId != null) {
    repositoryService.setDeploymentParentDeploymentId(childId, parentId);
}
Defensive patterns

Strategy: validation

Validate before calling

if (deploymentId == null || deploymentId.isEmpty()) {
    throw new IllegalArgumentException("deploymentId is required to set parent deployment");
}
repositoryService.setDeploymentParentDeploymentId(deploymentId, newParentDeploymentId);

Type guard

boolean childIdPresent = deploymentId != null && !deploymentId.isEmpty();

Prevention

When it happens

Trigger: Calling repositoryService.setDeploymentParentDeploymentId(null, newParentDeploymentId) or executing new SetDeploymentParentDeploymentIdCmd(null, parent).

Common situations: 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.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/6a1bb255edb3cc71. Report an issue: GitHub.