flowable/flowable-engine · error · FlowableIllegalArgumentException

caseDefinitionIds is null

Error message

caseDefinitionIds is null

What it means

Query-builder validation in CaseDefinitionQueryImpl.caseDefinitionIds: a null Set was passed as the id collection filter. Null is rejected because it would collide with the internal 'no filter' sentinel; use an empty query instead of null.

Solutions

  1. Only call caseDefinitionIds when the set is non-null; otherwise skip the call to leave the filter unset
  2. Coalesce null to an existing default set of ids

Example fix

// before
query.caseDefinitionIds(filter.getIds()); // may be null
// after
if (filter.getIds() != null) {
    query.caseDefinitionIds(filter.getIds());
}
Defensive patterns

Strategy: type-guard

Validate before calling

if (ids == null) { ids = Collections.emptySet(); /* or skip the filter */ }

Type guard

boolean usableIds = ids != null && !ids.isEmpty();

Try / catch

try {
    query.caseDefinitionIds(ids);
} catch (FlowableIllegalArgumentException e) {
    // drop the filter and retry the query without it
}

Prevention

When it happens

Trigger: Calling caseDefinitionQuery.caseDefinitionIds(null) to try to remove the filter or ignore it.

Common situations: Code that builds filter sets dynamically and passes through a null when the caller gave no filter; confusion between 'no filter' (simply don't call the method) and 'empty set'.

Related errors


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

Appendix: source

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

    public CaseDefinitionQueryImpl(CommandContext commandContext) {
        super(commandContext);
    }

    public CaseDefinitionQueryImpl(CommandExecutor commandExecutor) {
        super(commandExecutor);
    }

    @Override
    public CaseDefinitionQueryImpl caseDefinitionId(String caseDefinitionId) {
        this.id = caseDefinitionId;
        return this;
    }

    @Override
    public CaseDefinitionQuery caseDefinitionIds(Set<String> caseDefinitionIds) {
        if (caseDefinitionIds == null) {
            throw new FlowableIllegalArgumentException("caseDefinitionIds is null");
        } else if (caseDefinitionIds.isEmpty()) {
            throw new FlowableIllegalArgumentException("Empty caseDefinitionIds");
        }
        this.ids = caseDefinitionIds;
        return this;
    }

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

    @Override
    public CaseDefinitionQueryImpl caseDefinitionCategoryLike(String categoryLike) {

View on GitHub (pinned to d6d39ce1c6)