flowable/flowable-engine · error · FlowableIllegalArgumentException

Assignee is null

Error message

Assignee is null

What it means

TaskQueryImpl.taskAssignee(String) rejects a null assignee with FlowableIllegalArgumentException. Assignee is an exact-match filter on the task assignee column; null is not treated as 'unassigned' (use taskWithoutAssignee() semantics instead), so the method fails fast.

Solutions

  1. Skip the assignee criterion when the value is null (build the query conditionally).
  2. If unassigned tasks are meant, do not call taskAssignee at all — omit the filter (or use the unassigned variants).
  3. Resolve/validate the current user id before query construction and fail earlier with a clearer message.
  4. Catch FlowableIllegalArgumentException at the boundary and return 400.

Example fix

// before
query.taskAssignee(currentUserId); // null for anonymous
// after
if (currentUserId != null) {
    query.taskAssignee(currentUserId);
}
Defensive patterns

Strategy: validation

Validate before calling

if (assignee != null) {
    query.taskAssignee(assignee);
}

Type guard

boolean hasAssignee(String a) { return a != null && !a.isEmpty(); }

Try / catch

try {
    query.taskAssignee(assignee);
} catch (FlowableIllegalArgumentException e) {
    throw new BadRequestException("assignee filter must not be null", e);
}

Prevention

When it happens

Trigger: Calling taskAssignee(null), e.g. forwarding an optional 'assignedTo' request parameter or a user-context variable that is null for anonymous users.

Common situations: 'My tasks' pages where the current user id is null; API clients omitting the assignee parameter; migration code where the assignee field was removed upstream.

Related errors


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

Appendix: source

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

    }

    @Override
    public TaskQuery taskMaxPriority(Integer maxPriority) {
        if (maxPriority == null) {
            throw new FlowableIllegalArgumentException("Max Priority is null");
        }
        if (orActive) {
            currentOrQueryObject.maxPriority = maxPriority;
        } else {
            this.maxPriority = maxPriority;
        }
        return this;
    }

    @Override
    public TaskQueryImpl taskAssignee(String assignee) {
        if (assignee == null) {
            throw new FlowableIllegalArgumentException("Assignee is null");
        }
        if (orActive) {
            currentOrQueryObject.assignee = assignee;
        } else {
            this.assignee = assignee;
        }
        return this;
    }

    @Override
    public TaskQueryImpl taskAssigneeLike(String assigneeLike) {
        if (assigneeLike == null) {
            throw new FlowableIllegalArgumentException("AssigneeLike is null");
        }
        if (orActive) {
            currentOrQueryObject.assigneeLike = assigneeLike;
        } else {
            this.assigneeLike = assigneeLike;

View on GitHub (pinned to d6d39ce1c6)