flowable/flowable-engine · error · FlowableIllegalArgumentException
Only string variable values are supported when ignoring casi
Error message
Only string variable values are supported when ignoring casing, but was: " + actualValue.getClass().getName()
What it means
The equalsIgnoreCase variable comparison in historic task queries only supports String values; Flowable throws FlowableIllegalArgumentException with the actual value's class name when the deserialized value is not a String (e.g. Integer, Boolean, Date).
Source
Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java:371
Object actualValue = restResponseFactory.getVariableValue(variable);
// A value-only query is only possible using equals-operator
if (nameLess) {
throw new FlowableIllegalArgumentException("Value-only query (without a variable-name) is not supported.");
}
switch (variable.getVariableOperation()) {
case EQUALS:
taskInstanceQuery.taskVariableValueEquals(variable.getName(), actualValue);
break;
case EQUALS_IGNORE_CASE:
if (actualValue instanceof String) {
taskInstanceQuery.taskVariableValueEqualsIgnoreCase(variable.getName(), (String) actualValue);
} else {
throw new FlowableIllegalArgumentException("Only string variable values are supported when ignoring casing, but was: " + actualValue.getClass().getName());
}
break;
case NOT_EQUALS:
taskInstanceQuery.taskVariableValueNotEquals(variable.getName(), actualValue);
break;
case NOT_EQUALS_IGNORE_CASE:
if (actualValue instanceof String) {
taskInstanceQuery.taskVariableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);
} else {
throw new FlowableIllegalArgumentException("Only string variable values are supported when ignoring casing, but was: " + actualValue.getClass().getName());
}
break;
case GREATER_THAN:
taskInstanceQuery.taskVariableValueGreaterThan(variable.getName(), actualValue);
break;View on GitHub (pinned to d6d39ce1c6)
Solutions
- Send the value as a JSON string: {"operation":"equalsIgnoreCase","value":"foo"}
- For non-string variables switch to the type-specific 'equals'/'notEquals' operations instead of ignore-case variants
- Convert the variable to a String in the process data if case-insensitive comparison is required
Example fix
// before
{"name":"level","operation":"equalsIgnoreCase","value":5}
// after
{"name":"level","operation":"equals","value":5}
// or keep ignore-case with a string:
{"name":"level","operation":"equalsIgnoreCase","value":"high"} Defensive patterns
Strategy: type-guard
Validate before calling
if (!(variable.getValue() instanceof String))
throw new IllegalArgumentException("equalsIgnoreCase requires a String value"); Type guard
boolean isStringFilter(QueryVariable v) { return v.getValue() instanceof String; } Try / catch
try { queryTaskVariables(vars); }
catch (FlowableIllegalArgumentException e) { /* fall back to equals */ } Prevention
- Quote string values in JSON to avoid numeric coercion
- Use equals for non-string types
- Only use ignore-case operators for genuinely textual variables
When it happens
Trigger: POST /query/historic-tasks with a taskVariables entry using operation 'equalsIgnoreCase' whose value deserializes to a non-String type (numeric 5, boolean true, etc.).
Common situations: Client sends unquoted numbers/booleans in JSON; case-insensitive match attempted on an int/long variable; type drift after a variable type changed between versions.
Understand the failure class
Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.
Related errors
- Only string variable values are supported when ignoring casi
- Only string variable values are supported using like, but wa
- Only string variable values are supported when ignoring casi
- Variable operation is missing for variable: " + variable.get
- Variable value is missing for variable: " + variable.getName
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/67f091a807729f9d.
Report an issue: GitHub.