flowable/flowable-engine · error · FlowableIllegalArgumentException
Only string variable values are supported using like, but wa
Error message
Only string variable values are supported using like, but was:
What it means
The LIKE variable operator on historic task instance queries only accepts String values; Flowable throws FlowableIllegalArgumentException with the value's class name when the supplied value is not a String.
Source
Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java:407
break;
case GREATER_THAN_OR_EQUALS:
taskInstanceQuery.taskVariableValueGreaterThanOrEqual(variable.getName(), actualValue);
break;
case LESS_THAN:
taskInstanceQuery.taskVariableValueLessThan(variable.getName(), actualValue);
break;
case LESS_THAN_OR_EQUALS:
taskInstanceQuery.taskVariableValueLessThanOrEqual(variable.getName(), actualValue);
break;
case LIKE:
if (actualValue instanceof String) {
taskInstanceQuery.taskVariableValueLike(variable.getName(), (String) actualValue);
} else {
throw new FlowableIllegalArgumentException("Only string variable values are supported using like, but was: " + actualValue.getClass().getName());
}
break;
case LIKE_IGNORE_CASE:
if (actualValue instanceof String) {
taskInstanceQuery.taskVariableValueLikeIgnoreCase(variable.getName(), (String) actualValue);
} else {
throw new FlowableIllegalArgumentException("Only string variable values are supported using like, but was: " + actualValue.getClass().getName());
}
break;
case EXISTS:
taskInstanceQuery.taskVariableExists(variable.getName());
break;
case NOT_EXISTS:
taskInstanceQuery.taskVariableNotExists(variable.getName());
break;View on GitHub (pinned to d6d39ce1c6)
Solutions
- Quote the value in JSON: {"operation":"like","value":"%foo%"}
- Use 'equals' with an exact value for non-string types
- Convert the underlying variable to String if partial matching is required
Example fix
// before
{"name":"count","operation":"like","value":%5%}
// after
{"name":"description","operation":"like","value":"%urgent%"} Defensive patterns
Strategy: type-guard
Validate before calling
if (!(variable.getValue() instanceof String))
throw new IllegalArgumentException("like 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 like values in JSON: "%text%"
- Use equals for exact non-string matches
- Store searchable text as String variables
When it happens
Trigger: POST /query/historic-tasks with a taskVariables entry using operation 'like' whose value is a non-string (e.g. unquoted number or boolean).
Common situations: Wildcard search attempted on a numeric variable; JSON value not quoted; template that formats numbers into the like filter without string conversion.
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 when ignoring casi
- 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/9253086cfc98cf7f.
Report an issue: GitHub.