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

Guard in HistoricCaseInstanceBaseResource.addVariables for the EQUALS_IGNORE_CASE operation: case-insensitive comparison only makes sense for strings, but the supplied variable value is of another type (its class name is included in the message).

Source

Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceBaseResource.java:342

            if (nameLess && variable.getVariableOperation() != QueryVariableOperation.EQUALS) {
                throw new FlowableIllegalArgumentException("Value-only query (without a variable-name) is only supported when using 'equals' operation.");
            }

            switch (variable.getVariableOperation()) {

            case EQUALS:
                if (nameLess) {
                    caseInstanceQuery.variableValueEquals(actualValue);
                } else {
                    caseInstanceQuery.variableValueEquals(variable.getName(), actualValue);
                }
                break;

            case EQUALS_IGNORE_CASE:
                if (actualValue instanceof String) {
                    caseInstanceQuery.variableValueEqualsIgnoreCase(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:
                caseInstanceQuery.variableValueNotEquals(variable.getName(), actualValue);
                break;

            case LIKE:
                if (actualValue instanceof String) {
                    caseInstanceQuery.variableValueLike(variable.getName(), (String) actualValue);
                } else {
                    throw new FlowableIllegalArgumentException("Only string variable values are supported for like, but was: " + actualValue.getClass().getName());
                }
                break;

            case LIKE_IGNORE_CASE:
                if (actualValue instanceof String) {
                    caseInstanceQuery.variableValueLikeIgnoreCase(variable.getName(), (String) actualValue);

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Use operation "equals" for non-string values
  2. Quote the value in JSON so it arrives as a String ("value":"42") if case-insensitive matching is truly intended
  3. Check the variable's actual type and choose the matching operation
  4. Note: boolean values serialized as strings may still fail conversion — prefer equals for them

Example fix

// before
{"name":"count","operation":"equalsIgnoreCase","value":5}
// after
{"name":"count","operation":"equals","value":5}
Defensive patterns

Strategy: type-guard

Validate before calling

if (!"equals".equals(op) && value != null && !(value instanceof String))
  throw new IllegalArgumentException("equalsIgnoreCase requires a String value");

Type guard

boolean isStringVariableOp(Map<String,Object> v) {
  return v.get("value") instanceof String || !String.valueOf(v.get("operation")).contains("IgnoreCase");
}

Try / catch

try { ... } catch (FlowableIllegalArgumentException e) {
  return retryWithOperationEquals(request);
}

Prevention

When it happens

Trigger: POST query with {"name":"x","operation":"equalsIgnoreCase","value":42} — the resolved value is an Integer/Long/Boolean, not a String.

Common situations: Client sends a number/boolean and assumes case-insensitive compare works; JSON numbers parsed as integers instead of strings; copy-pasted equalsIgnoreCase for numeric variables.

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


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