flowable/flowable-engine · error · FlowableIllegalArgumentException

The given variable value is not a localDate: '" +…

Error message

The given variable value is not a localDate: '" + result.getValue() + "'

What it means

After confirming the REST value is a String, LocalDateRestVariableConverter.getVariableValue attempts LocalDate.parse. If the string is not a valid ISO-8601 date (yyyy-MM-dd), the DateTimeParseException is wrapped in FlowableIllegalArgumentException with the offending value in the message and the parse exception as cause.

Solutions

  1. Format the value as ISO-8601 yyyy-MM-dd (e.g. LocalDate.toString() or DateTimeFormatter.ISO_LOCAL_DATE) before sending.
  2. Validate/parse the string client-side with LocalDate.parse to fail fast with a clearer message.
  3. If the value includes a time part, switch the variable to localDateTime type or strip the time.
  4. Normalize client date pickers to output ISO format.

Example fix

// before
variable.setValue("10/09/2026");

// after
variable.setValue(LocalDate.of(2026, 9, 10).toString()); // "2026-09-10"
Defensive patterns

Strategy: validation

Validate before calling

try {
    LocalDate.parse(value);
} catch (DateTimeParseException e) {
    throw new IllegalArgumentException("Value must be ISO yyyy-MM-dd, got: " + value, e);
}

Type guard

static boolean isValidIsoLocalDate(String s) {
    try { LocalDate.parse(s); return true; } catch (DateTimeParseException | NullPointerException e) { return false; }
}

Try / catch

try {
    Object value = converter.getVariableValue(restVar);
} catch (FlowableIllegalArgumentException e) {
    if (e.getCause() instanceof DateTimeParseException dpe) {
        log.error("localDate '{}' is not ISO yyyy-MM-dd", restVar.getValue(), dpe);
    }
}

Prevention

When it happens

Trigger: Posting a localDate REST variable whose string value is not parseable by LocalDate.parse: e.g. "10-09-2026", "2026/09/10", "2026-09-10T10:00:00", "20260910", or an empty string.

Common situations: Locale-dependent date formatting from clients (dd/MM/yyyy), datetime strings sent to date-only variables, timezone-suffixed strings, whitespace or empty values from form inputs.

Related errors


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

Appendix: source

Thrown at modules/flowable-common-rest/src/main/java/org/flowable/common/rest/variable/LocalDateRestVariableConverter.java:44

    public String getRestTypeName() {
        return "localDate";
    }

    @Override
    public Class<?> getVariableType() {
        return LocalDate.class;
    }

    @Override
    public Object getVariableValue(EngineRestVariable result) {
        if (result.getValue() != null) {
            if (!(result.getValue() instanceof String)) {
                throw new FlowableIllegalArgumentException("Converter can only convert string to localDate");
            }
            try {
                return LocalDate.parse((String) result.getValue());
            } catch (DateTimeParseException e) {
                throw new FlowableIllegalArgumentException("The given variable value is not a localDate: '" + result.getValue() + "'", e);
            }
        }
        return null;
    }

    @Override
    public void convertVariableValue(Object variableValue, EngineRestVariable result) {
        if (variableValue != null) {
            if (!(variableValue instanceof LocalDate)) {
                throw new FlowableIllegalArgumentException("Converter can only convert localDate");
            }
            result.setValue(variableValue.toString());
        } else {
            result.setValue(null);
        }
    }

}

View on GitHub (pinned to d6d39ce1c6)