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

Flowable's historic process instance query REST API only supports case-insensitive equality on String variables. When the EQUALS_IGNORE_CASE variable operation is requested but the resolved variable value is not a String, addVariables throws FlowableIllegalArgumentException naming the offending Java class.

Source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceBaseResource.java:344

            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) {
                    processInstanceQuery.variableValueEquals(actualValue);
                } else {
                    processInstanceQuery.variableValueEquals(variable.getName(), actualValue);
                }
                break;

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

            case LIKE:
                if (actualValue instanceof String) {
                    processInstanceQuery.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) {
                    processInstanceQuery.variableValueLikeIgnoreCase(variable.getName(), (String) actualValue);

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Change variableOperation to EQUALS which accepts any comparable variable type
  2. Send the value as a JSON string (e.g. "123" instead of 123) when using EQUALS_IGNORE_CASE
  3. Coerce the value to String on the client before sending the request

Example fix

// before
{"name":"orderNr","type":"integer","value":123,"variableOperation":"EQUALS_IGNORE_CASE"}
// after
{"name":"orderNr","value":"123","variableOperation":"EQUALS_IGNORE_CASE"}
Defensive patterns

Strategy: validation

Validate before calling

if (typeof variable.value === 'string') { /* send EQUALS_IGNORE_CASE */ } else { variable.variableOperation = 'EQUALS'; }

Type guard

const isString = (v) => typeof v === 'string';

Try / catch

catch (e) { if (e.response && e.response.status === 400 && /Only string variable values/.test(e.response.data.message)) { /* retry with EQUALS */ } else throw e; }

Prevention

When it happens

Trigger: POST/GET to history process instance query endpoints with a variable entry whose variableOperation is EQUALS_IGNORE_CASE and whose value deserializes to a non-String type (Integer, Boolean, Date, etc.).

Common situations: Clients building dynamic query UIs that pass user input typed as numbers; JSON bodies where the value is numeric or boolean but the operation requests case-insensitive comparison; API clients copied from EQUALS examples and only changing the operation.

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/ef8d4fffa2f349dd. Report an issue: GitHub.