flowable/flowable-engine · error · FlowableIllegalArgumentException

Task name list is null

Error message

Task name list is null

What it means

HistoricTaskInstanceQueryImpl.taskNameIn(Collection) throws FlowableIllegalArgumentException when the taskNameList collection is null. The names are bound into the query's IN clause, which requires a concrete list of strings. Flowable rejects the null argument immediately at query construction.

Solutions

  1. Initialize the collection before calling taskNameIn.
  2. Guard the call with a null/empty check and skip it when no names are configured.
  3. Have the producing code return an empty list rather than null, and skip the call on empty.

Example fix

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

Strategy: validation

Validate before calling

if (taskNameList == null || taskNameList.isEmpty()) {
    throw new IllegalArgumentException("taskNameIn requires a non-empty list");
}

Type guard

boolean hasNames(Collection<String> names) {
    return names != null && !names.isEmpty();
}

Try / catch

try {
    query.taskNameIn(names);
} catch (FlowableIllegalArgumentException e) {
    logger.warn("Invalid task name list: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Calling historicTaskInstanceQuery().taskNameIn(null), usually when the name list originates from an uninitialized variable, a null-returning service, or an unset configuration value.

Common situations: Optional task-name filter feature whose backing list was never set; REST handler passing through a missing request parameter as null; cache/lookup miss returning null.

Related errors


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

Appendix: source

Thrown at modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/HistoricTaskInstanceQueryImpl.java:739

            this.taskIds = taskIds;
        }
        return this;
    }

    @Override
    public HistoricTaskInstanceQuery taskName(String taskName) {
        if (inOrStatement) {
            this.currentOrQueryObject.taskName = taskName;
        } else {
            this.taskName = taskName;
        }
        return this;
    }

    @Override
    public HistoricTaskInstanceQuery taskNameIn(Collection<String> taskNameList) {
        if (taskNameList == null) {
            throw new FlowableIllegalArgumentException("Task name list is null");
        }
        if (taskNameList.isEmpty()) {
            throw new FlowableIllegalArgumentException("Task name list is empty");
        }

        if (taskName != null) {
            throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and taskName");
        }
        if (taskNameLike != null) {
            throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and taskNameLike");
        }
        if (taskNameLikeIgnoreCase != null) {
            throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and taskNameLikeIgnoreCase");
        }

        if (inOrStatement) {
            currentOrQueryObject.taskNameList = taskNameList;
        } else {

View on GitHub (pinned to d6d39ce1c6)