flowable/flowable-engine · error · ActivitiIllegalArgumentException

Assignee is null

Error message

Assignee is null

What it means

Thrown by TaskQueryImpl.taskAssignee(String) when the assignee argument is null. The assignee filter requires an exact user id string; a null would make the filter meaningless, so the query builder rejects it eagerly with ActivitiIllegalArgumentException before the query is ever executed.

Solutions

  1. Pass a non-null user id string to taskAssignee.
  2. Resolve/verify the user id before building the query; skip the filter (or fail the request) when it is absent.
  3. Add an early check in the controller/service: require an assignee for this query type.
  4. Catch ActivitiIllegalArgumentException and map it to a client error response.

Example fix

// before
String user = securityContext.getUserId(); // may be null
query.taskAssignee(user);

// after
String user = securityContext.getUserId();
if (user != null) {
    query.taskAssignee(user);
} else {
    throw new AuthenticationException("Assignee required");
}
Defensive patterns

Strategy: validation

Validate before calling

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

Type guard

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

Try / catch

try {
    query.taskAssignee(assignee);
} catch (ActivitiIllegalArgumentException e) {
    throw new BadRequestException("Assignee filter invalid: " + e.getMessage());
}

Prevention

When it happens

Trigger: Calling taskQuery.taskAssignee(null), or passing a variable holding the current user id that is null because no user is authenticated / the lookup returned nothing.

Common situations: Security context has no authenticated principal; UserService.lookup returned null for an unknown user id; a task-list page built a query before the assignee was resolved.

Related errors


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

Appendix: source

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

    }

    @Override
    public TaskQuery taskMaxPriority(Integer maxPriority) {
        if (maxPriority == null) {
            throw new ActivitiIllegalArgumentException("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 ActivitiIllegalArgumentException("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 ActivitiIllegalArgumentException("AssigneeLike is null");
        }
        if (orActive) {
            currentOrQueryObject.assigneeLike = assignee;
        } else {
            this.assigneeLike = assigneeLike;

View on GitHub (pinned to d6d39ce1c6)