flowable/flowable-engine · error · FlowableIllegalArgumentException

Priority is null

Error message

Priority is null

What it means

TaskQuery.taskPriority(Integer) rejects null priority with FlowableIllegalArgumentException. Priority is an exact-match integer filter; because Java autoboxing makes it easy to pass a null Integer, the method checks explicitly and fails fast.

Solutions

  1. Only call taskPriority when the Integer is non-null.
  2. Default to a sentinel/standard priority (e.g. Task.PRIORITY_NORMAL = 50) when unset.
  3. Use primitive int in your own code path and convert deliberately.
  4. Catch FlowableIllegalArgumentException and return a validation error to the caller.

Example fix

// before
query.taskPriority(filter.getPriority()); // Integer may be null
// after
if (filter.getPriority() != null) {
    query.taskPriority(filter.getPriority());
}
Defensive patterns

Strategy: validation

Validate before calling

if (priority != null) {
    query.taskPriority(priority);
}

Type guard

boolean hasPriority(Integer p) { return p != null && p >= 0; }

Try / catch

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

Prevention

When it happens

Trigger: Calling taskPriority(null), often from an unboxed/unset Integer field or an optional priority request parameter.

Common situations: REST query DTOs where priority was omitted; conversion code mapping UI form values into Integer and leaving null; mixing primitive int and wrapper Integer refactors.

Related errors


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

Appendix: source

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

    }

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

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

    @Override
    public TaskQuery taskMinPriority(Integer minPriority) {
        if (minPriority == null) {
            throw new FlowableIllegalArgumentException("Min Priority is null");
        }
        if (orActive) {
            currentOrQueryObject.minPriority = minPriority;
        } else {
            this.minPriority = minPriority;

View on GitHub (pinned to d6d39ce1c6)