flowable/flowable-engine · error · ActivitiIllegalArgumentException

Priority is null

Error message

Priority is null

What it means

TaskQuery.taskPriority(Integer) requires a non-null priority. Since priority is a boxed Integer, callers can accidentally pass null; the engine throws ActivitiIllegalArgumentException to prevent building a meaningless equality filter.

Solutions

  1. Only call taskPriority when the value is non-null; omit the filter for 'any priority'
  2. Use a primitive int default only when a concrete priority is required, guarding the boxed value first
  3. Validate at the API layer that priority filter requests include a numeric value

Example fix

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

Strategy: type-guard

Validate before calling

if (priority == null) { /* omit priority filter */ }

Type guard

void addPriorityFilter(TaskQuery query, Integer priority) {
    if (priority != null) {
        query.taskPriority(priority);
    }
}

Try / catch

try {
    query.taskPriority(priority);
} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {
    // priority was null: build query without it
}

Prevention

When it happens

Trigger: Calling taskPriority(null), typically from an Integer variable that was never assigned, an unset form field, or Optional.orElse(null).

Common situations: Priority filters sourced from UI dropdowns defaulting to null for 'any priority'; JSON payloads missing the priority key; Integer unboxing refactors.

Related errors


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

Appendix: source

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

    }

    @Override
    public TaskQuery taskDescriptionLikeIgnoreCase(String descriptionLikeIgnoreCase) {
        if (descriptionLikeIgnoreCase == null) {
            throw new ActivitiIllegalArgumentException("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 ActivitiIllegalArgumentException("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 ActivitiIllegalArgumentException("Min Priority is null");
        }
        if (orActive) {
            currentOrQueryObject.minPriority = minPriority;
        } else {
            this.minPriority = minPriority;

View on GitHub (pinned to d6d39ce1c6)