flowable/flowable-engine · error · ActivitiIllegalArgumentException

Task assignee list is null

Error message

Task assignee list is null

What it means

Thrown by TaskQueryImpl.taskAssigneeIds(List<String>) when the assigneeIds list itself is null. The method builds an IN-clause over the given assignee ids; a null list is invalid input, so the query builder rejects it immediately with ActivitiIllegalArgumentException.

Solutions

  1. Pass a non-null, non-empty List<String> of assignee ids.
  2. Guard the call: only invoke taskAssigneeIds when the list is non-null.
  3. Return Collections.emptyList() (and skip the filter) instead of null from the lookup.
  4. Initialize the collection field in the DTO/filter object.
  5. Catch ActivitiIllegalArgumentException at the boundary and report invalid input.

Example fix

// before
List<String> ids = getSelectedUserIds(); // may be null
query.taskAssigneeIds(ids);

// after
List<String> ids = getSelectedUserIds();
if (ids != null && !ids.isEmpty()) {
    query.taskAssigneeIds(ids);
}
Defensive patterns

Strategy: validation

Validate before calling

if (assigneeIds != null && !assigneeIds.isEmpty()) {
    query.taskAssigneeIds(assigneeIds);
}

Type guard

boolean isNonEmptyList(List<String> l) { return l != null && !l.isEmpty(); }

Try / catch

try {
    query.taskAssigneeIds(assigneeIds);
} catch (ActivitiIllegalArgumentException e) {
    throw new BadRequestException("Assignee ids invalid: " + e.getMessage());
}

Prevention

When it happens

Trigger: Calling taskQuery.taskAssigneeIds(null) or passing a collection variable that was never initialized / came back null from a service or mapper.

Common situations: A bulk 'tasks for these users' screen where the selected-users collection is null; group membership lookup returning null instead of an empty list; JSON deserialization leaving the ids field unset.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java:378

    }

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

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

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

View on GitHub (pinned to d6d39ce1c6)