flowable/flowable-engine · error · FlowableIllegalArgumentException

id is null

Error message

id is null

What it means

FlowableIllegalArgumentException with the (historically misworded) message "id is null" thrown by CaseDefinitionQueryImpl.deploymentId(String). Despite the message text, the null value in question is the deploymentId parameter. The engine rejects a null deployment id because filtering case definitions by a null deployment would be meaningless; use deploymentId only when you have an actual deployment identifier.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CaseDefinitionQueryImpl.java:150

            throw new FlowableIllegalArgumentException("nameLike is null");
        }
        this.nameLike = nameLike;
        return this;
    }

    @Override
    public CaseDefinitionQueryImpl caseDefinitionNameLikeIgnoreCase(String nameLikeIgnoreCase) {
        if (nameLikeIgnoreCase == null) {
            throw new FlowableIllegalArgumentException("nameLikeIgnoreCase is null");
        }
        this.nameLikeIgnoreCase = nameLikeIgnoreCase;
        return this;
    }

    @Override
    public CaseDefinitionQueryImpl deploymentId(String deploymentId) {
        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("id is null");
        }
        this.deploymentId = deploymentId;
        return this;
    }

    @Override
    public CaseDefinitionQueryImpl deploymentIds(Set<String> deploymentIds) {
        if (deploymentIds == null) {
            throw new FlowableIllegalArgumentException("ids are null");
        } else if (deploymentIds.isEmpty()) {
            throw new FlowableIllegalArgumentException("ids is an empty collection");
        }
        this.deploymentIds = deploymentIds;
        return this;
    }

    @Override
    public CaseDefinitionQuery parentDeploymentId(String parentDeploymentId) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass a real deployment id string obtained from Deployment.getId().
  2. Skip the deploymentId filter when the id is null.
  3. Verify the earlier step that produced the deployment id (it may have failed to find the deployment).

Example fix

// before
Deployment d = repositoryService.createDeploymentQuery().deploymentName("cases").singleResult();
query.deploymentId(d.getId()); // NPE/IAE when d is null

// after
Deployment d = repositoryService.createDeploymentQuery().deploymentName("cases").singleResult();
if (d != null) {
    query.deploymentId(d.getId());
}
Defensive patterns

Strategy: validation

Validate before calling

if (deploymentId != null) {
    query.deploymentId(deploymentId);
}

Type guard

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

Try / catch

try {
    query.deploymentId(deploymentId);
} catch (FlowableIllegalArgumentException e) {
    throw new IllegalStateException("deploymentId was null — earlier lookup failed?", e);
}

Prevention

When it happens

Trigger: Calling caseDefinitionQuery.deploymentId(null) — often when the deployment id was derived from a prior lookup (e.g. a deployment query) that returned nothing.

Common situations: Chained flows where code fetches a deployment then queries its case definitions; the first step silently failed or returned null, and the null id was forwarded.

Related errors


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