flowable/flowable-engine · error · FlowableIllegalArgumentException

Priority does not resolve to a number: + priority

Error message

Priority does not resolve to a number: + priority

What it means

The user task's flowable:priority expression produced a String that could not be parsed as an integer for the task priority. When the expression yields a String the engine tries Integer.valueOf and throws FlowableIllegalArgumentException on NumberFormatException. Note there is a separate variant of this message for non-String, non-Number types (error 2086).

Source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/UserTaskActivityBehavior.java:289

                    Date localDueDate = Date.from(((LocalDateTime) dueDate).atZone(ZoneId.systemDefault()).toInstant());
                    task.setDueDate(localDueDate);
                } else {
                    throw new FlowableIllegalArgumentException("Due date expression does not resolve to a Date, Instant, LocalDate, LocalDateTime or Date string: " + beforeContext.getDueDate());
                }
            }
        }
    }

    protected void handlePriority(CreateUserTaskBeforeContext beforeContext, ExpressionManager expressionManager, TaskEntity task, DelegateExecution execution,
            String activeTaskPriority) {
        if (StringUtils.isNotEmpty(beforeContext.getPriority())) {
            final Object priority = expressionManager.createExpression(beforeContext.getPriority()).getValue(execution);
            if (priority != null) {
                if (priority instanceof String) {
                    try {
                        task.setPriority(Integer.valueOf((String) priority));
                    } catch (NumberFormatException e) {
                        throw new FlowableIllegalArgumentException("Priority does not resolve to a number: " + priority, e);
                    }
                } else if (priority instanceof Number) {
                    task.setPriority(((Number) priority).intValue());
                } else {
                    throw new FlowableIllegalArgumentException("Priority expression does not resolve to a number: " + activeTaskPriority);
                }
            }
        }
    }

    protected void handleCategory(CreateUserTaskBeforeContext beforeContext, ExpressionManager expressionManager, TaskEntity task,
            DelegateExecution execution) {
        if (StringUtils.isNotEmpty(beforeContext.getCategory())) {
            String category = null;
            try {
                Object categoryValue = expressionManager.createExpression(beforeContext.getCategory()).getValue(execution);
                if (categoryValue != null) {
                    category = categoryValue.toString();

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Ensure the variable/expression result is an Integer/Number, or a String containing only an integer
  2. Convert textual labels to numbers before the user task (e.g. mapping high -> 100)
  3. Fix the string format (strip commas/units) in the source of the value
  4. Use Integer.valueOf in a delegate to normalize and fail early with a clearer message

Example fix

// before
execution.setVariable("taskPriority", "high");
// after
execution.setVariable("taskPriority", 100);
Defensive patterns

Strategy: validation

Validate before calling

Object p = priorityExpr.getValue(execution);
if (p instanceof String && !((String) p).matches("\\d+")) {
    throw new IllegalArgumentException("Priority string must be an integer: " + p);
}

Type guard

boolean isValidPriority(Object v) {
    return v == null || v instanceof Number || (v instanceof String && ((String) v).matches("\\d+"));
}

Try / catch

try {
    taskService.complete(taskId, vars);
} catch (FlowableIllegalArgumentException e) {
    if (e.getMessage().startsWith("Priority")) {
        // correct the priority variable to an integer
    }
}

Prevention

When it happens

Trigger: flowable:priority expression like ${priorityVar} resolving to a non-numeric String, e.g. "high", "urgent", "", or a number with trailing characters.

Common situations: Process variable set to a textual priority label; expression returning a formatted number like "1,000"; form data stored as String instead of Integer; locale-formatted numbers.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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