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

FlowableIllegalArgumentException thrown when EQUALS_IGNORE_CASE is used with a non-String variable value. Case-insensitive comparison is only defined for strings, so Flowable rejects numeric, boolean, date, or other value types with a 400 error naming the offending Java class.

Source

Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/task/HistoricTaskInstanceBaseResource.java:352

            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

  1. Change the operation to EQUALS (or NOT_EQUALS) for non-string values: {"name":"count","operation":"EQUALS","value":5}.
  2. If case-insensitive matching is truly needed, send the value as a string: {"value":"kermit","operation":"EQUALS_IGNORE_CASE"}.
  3. Client-side: only offer EQUALS_IGNORE_CASE/NOT_EQUALS_IGNORE_CASE when typeof value === 'string'.
  4. Normalize the variable to a string type in the process/task data if ignore-case search is a requirement.

Example fix

// before
{"name":"count","operation":"EQUALS_IGNORE_CASE","value":5}
// after
{"name":"count","operation":"EQUALS","value":5}
Defensive patterns

Strategy: validation

Validate before calling

function validateIgnoreCase(v) {
  if ((v.operation === "EQUALS_IGNORE_CASE") && typeof v.value !== "string") {
    throw new Error("EQUALS_IGNORE_CASE requires a string value");
  }
}

Type guard

const canIgnoreCase = (v) => typeof v.value === 'string';

Prevention

When it happens

Trigger: POST /cmmn-history/historic-task-instances/query with {"name":"count","operation":"EQUALS_IGNORE_CASE","value":5} - any non-string value under EQUALS_IGNORE_CASE in addTaskVariables.

Common situations: Generic UIs letting users pick 'ignore case' for any variable type; JSON numbers/booleans deserialized to non-String objects; variables stored as Integer/Date mistakenly queried with ignore-case semantics.

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