flowable/flowable-engine · error · FlowableIllegalArgumentException

assignee is null

Error message

assignee is null

What it means

PlanItemInstanceQueryImpl.planItemInstanceAssignee(String) throws FlowableIllegalArgumentException with message "assignee is null" when the assignee argument is null. Null is rejected because it cannot be translated into a SQL filter; callers should omit the criterion to mean 'no assignee filter'.

Solutions

  1. Guard with a null check and only add the criterion when an assignee is actually present
  2. If the intent is 'unassigned', use the dedicated no-assignee/without-assignee query option instead of null
  3. Validate the incoming filter parameter at the API boundary before querying
  4. Catch FlowableIllegalArgumentException as a last resort around query building

Example fix

// before
query.planItemInstanceAssignee(assignee); // throws when null
// after
if (assignee != null) {
    query.planItemInstanceAssignee(assignee);
}
Defensive patterns

Strategy: validation

Validate before calling

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

Type guard

boolean hasAssignee = assignee != null;

Try / catch

try {
    query.planItemInstanceAssignee(assignee);
} catch (FlowableIllegalArgumentException e) {
    log.warn("assignee was null, filter skipped");
}

Prevention

When it happens

Trigger: Calling planItemInstanceAssignee(null), often when the assignee comes from a nullable task field, an unset variable, or an optional API parameter.

Common situations: Task list views that pass the currently selected assignee filter straight through; unclaimed tasks with no assignee whose value is propagated into a follow-up query; null returns from identity/user lookup services.

Related errors


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

Appendix: source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java:729

    }

    @Override
    public PlanItemInstanceQuery planItemInstanceStartUserId(String startUserId) {
        if (startUserId == null) {
            throw new FlowableIllegalArgumentException("Start user id is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.startUserId = startUserId;
        } else {
            this.startUserId = startUserId;
        }
        return this;
    }

    @Override
    public PlanItemInstanceQuery planItemInstanceAssignee(String assignee) {
        if (assignee == null) {
            throw new FlowableIllegalArgumentException("assignee is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.assignee = assignee;
        } else {
            this.assignee = assignee;
        }
        return this;
    }

    @Override
    public PlanItemInstanceQuery planItemInstanceCompletedBy(String completedBy) {
        if (completedBy == null) {
            throw new FlowableIllegalArgumentException("completedBy is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.completedBy = completedBy;
        } else {
            this.completedBy = completedBy;

View on GitHub (pinned to d6d39ce1c6)