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: 

What it means

Flowable's CMMN REST task query only allows case-insensitive equality comparison on process variables whose value is a String. When EQUALS_IGNORE_CASE is requested with a non-String value (e.g. Integer, Boolean), TaskBaseResource.addProcessvariables throws FlowableIllegalArgumentException, appending the value's actual class name to the message.

Source

Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskBaseResource.java:491

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

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

            case NOT_EQUALS_IGNORE_CASE:
                if (actualValue instanceof String) {
                    taskQuery.processVariableValueNotEqualsIgnoreCase(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:
                taskQuery.processVariableValueGreaterThan(variable.getName(), actualValue);
                break;

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Send the variable value as a JSON string (e.g. "42" not 42) when using EQUALS_IGNORE_CASE
  2. Use plain EQUALS / NOT_EQUALS operations, which accept any variable type
  3. Cast or convert the variable value to a String on the client before querying
  4. Check the actualValue class name in the message to identify the offending type and adjust the payload

Example fix

// before
{"processVariables":[{"name":"priority","value":2,"variableOperation":"EQUALS_IGNORE_CASE"}]}
// after
{"processVariables":[{"name":"priority","value":"2","variableOperation":"EQUALS_IGNORE_CASE"}]}
Defensive patterns

Strategy: validation

Validate before calling

if (typeof variable.value !== 'string') throw new Error('EQUALS_IGNORE_CASE requires a string value for variable ' + variable.name);
await queryTasks({ processVariables: [{ name: variable.name, value: String(variable.value), variableOperation: 'EQUALS_IGNORE_CASE' }] });

Type guard

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

Try / catch

try { await queryTasks(req); } catch (e) { if (e.message.includes('Only string variable values are supported when ignoring casing')) { req.processVariables = req.processVariables.map(v => ({...v, value: String(v.value)})); return queryTasks(req); } throw e; }

Prevention

When it happens

Trigger: POST /cmmn-query/tasks with a queryRequest containing a task/processVariables entry whose variableOperation is EQUALS_IGNORE_CASE and whose value deserializes as a non-String (number, boolean, object, array).

Common situations: Client sends numeric or boolean variable values with equalsIgnoreCase; JSON body variables typed as numbers/booleans while the REST filter requires strings; migrating queries from non-ignore-case (any type allowed) to ignore-case variants.

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