flowable/flowable-engine · error · FlowableIllegalArgumentException

Task name list is null

Error message

Task name list is null

What it means

Flowable throws this FlowableIllegalArgumentException when TaskQuery.taskNameIn(null) is called. The IN-filter needs a non-null collection to produce a valid SQL IN clause, so a null list is rejected immediately during query construction.

Solutions

  1. Null-check the collection before calling taskNameIn and skip the filter (or throw a clear error) when null.
  2. Pass an empty list only if you also guard against the related empty-list error - better to omit the filter entirely.
  3. Make the producer of the collection initialize it to an empty list instead of null.
  4. Validate the input collection at the service boundary with Objects.requireNonNull and a meaningful message.

Example fix

// before
query.taskNameIn(names); // throws when names == null
// after
if (names != null && !names.isEmpty()) {
    query.taskNameIn(names);
}
Defensive patterns

Strategy: validation

Validate before calling

if (names == null || names.isEmpty()) {
    // skip filter or throw
} else {
    query.taskNameIn(names);
}

Type guard

boolean isNonEmpty(Collection<?> c) { return c != null && !c.isEmpty(); }

Try / catch

try {
    query.taskNameIn(names);
} catch (FlowableIllegalArgumentException e) {
    if (e.getMessage().equals("Task name list is null")) {
        throw new BadRequestException("name list must not be null", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling createTaskQuery().taskNameIn(null), typically when the name collection originates from an unset field, a failed lookup, or an unvalidated method argument.

Common situations: Report/dashboard queries where the list of candidate names was never populated; code paths where an upstream service returned null instead of an empty list.

Related errors


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

Appendix: source

Thrown at modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java:253

    @Override
    public TaskQueryImpl taskName(String name) {
        if (name == null) {
            throw new FlowableIllegalArgumentException("Task name is null");
        }

        if (orActive) {
            currentOrQueryObject.name = name;
        } else {
            this.name = name;
        }
        return this;
    }

    @Override
    public TaskQuery taskNameIn(Collection<String> nameList) {
        if (nameList == null) {
            throw new FlowableIllegalArgumentException("Task name list is null");
        }
        if (nameList.isEmpty()) {
            throw new FlowableIllegalArgumentException("Task name list is empty");
        }
        for (String name : nameList) {
            if (name == null) {
                throw new FlowableIllegalArgumentException("None of the given task names can be null");
            }
        }

        if (name != null) {
            throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and name");
        }
        if (nameLike != null) {
            throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and nameLike");
        }
        if (nameLikeIgnoreCase != null) {
            throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and nameLikeIgnoreCase");

View on GitHub (pinned to d6d39ce1c6)