flowable/flowable-engine · error · FlowableIllegalArgumentException

Task assignee list is null

Error message

Task assignee list is null

What it means

TaskQueryImpl.taskAssigneeIds(Collection<String>) rejects a null collection before building the query. Flowable validates query inputs eagerly so invalid filters fail at query construction rather than producing an empty or broken SQL query. Throwing FlowableIllegalArgumentException here surfaces the programming mistake immediately at the call site.

Solutions

  1. Ensure the collection passed to taskAssigneeIds is non-null; initialize it to Collections.emptyList() or a real list at declaration.
  2. If the caller legitimately has no assignees, skip calling taskAssigneeIds instead of passing null.
  3. Guard with an early null check before building the query and choose an alternative filter path.

Example fix

// before
taskQuery.taskAssigneeIds(userService.getAssigneeIds(userId));

// after
List<String> assigneeIds = userService.getAssigneeIds(userId);
if (assigneeIds != null && !assigneeIds.isEmpty()) {
    taskQuery.taskAssigneeIds(assigneeIds);
}
Defensive patterns

Strategy: validation

Validate before calling

if (assigneeIds == null) { throw new IllegalArgumentException("assigneeIds required"); }
taskQuery.taskAssigneeIds(assigneeIds);

Type guard

boolean usable = assigneeIds != null;

Try / catch

try {
    taskQuery.taskAssigneeIds(assigneeIds);
} catch (FlowableIllegalArgumentException e) {
    if (!"Task assignee list is null".equals(e.getMessage())) throw e;
    logger.warn("No assignee IDs supplied; building unfiltered query", e);
}

Prevention

When it happens

Trigger: Calling taskQuery.taskAssigneeIds(null) — typically when the assignee collection is a variable that was never initialized or a method returned null instead of an empty list.

Common situations: Assignee IDs fetched from an external service or config map returning null; a nullable method parameter forwarded straight into the query builder; refactoring from taskAssignee(String) to taskAssigneeIds(Collection) without null-checking the new argument.

Related errors


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

Appendix: source

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

    }

    @Override
    public TaskQuery taskAssigneeLikeIgnoreCase(String assigneeLikeIgnoreCase) {
        if (assigneeLikeIgnoreCase == null) {
            throw new FlowableIllegalArgumentException("assigneeLikeIgnoreCase is null");
        }
        if (orActive) {
            currentOrQueryObject.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();
        } else {
            this.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();
        }
        return this;
    }

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

        if (assignee != null) {
            throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssignee");
        }
        if (assigneeLike != null) {
            throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLike");
        }
        if (assigneeLikeIgnoreCase != null) {
            throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLikeIgnoreCase");

View on GitHub (pinned to d6d39ce1c6)