flowable/flowable-engine · error · FlowableIllegalArgumentException

Only string variable values are supported using like, but…

Error message

Only string variable values are supported using like, but was: 

What it means

LIKE variable filtering in the CMMN REST task query is only supported for String values. If a processVariables entry uses LIKE with a non-String value, addProcessvariables throws FlowableIllegalArgumentException with the value's class name.

Solutions

  1. Send the LIKE pattern as a JSON string (e.g. "%42%")
  2. Drop the numeric/boolean like filter or use EQUALS with the exact value
  3. Convert the value to String before querying
  4. Review the class name in the message to fix the payload type

Example fix

// before
{"processVariables":[{"name":"amount","value":100,"variableOperation":"LIKE"}]}
// after
{"processVariables":[{"name":"amount","value":"%100%","variableOperation":"LIKE"}]}
Defensive patterns

Strategy: validation

Validate before calling

if (variableOperation === 'LIKE' && typeof value !== 'string') throw new Error('LIKE requires a string pattern');

Type guard

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

Try / catch

try { await queryTasks(req); } catch (e) { if (e.message.includes('Only string variable values are supported using like')) { /* fix payload or fall back to EQUALS */ } throw e; }

Prevention

When it happens

Trigger: POST /cmmn-query/tasks with a processVariables entry whose variableOperation is LIKE and whose value is a number, boolean, object or array.

Common situations: Appending SQL-like wildcards to numeric variables; clients building dynamic queries assuming like works on all types; JSON values not wrapped as strings.

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

Appendix: source

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

                break;

            case GREATER_THAN_OR_EQUALS:
                taskQuery.processVariableValueGreaterThanOrEqual(variable.getName(), actualValue);
                break;

            case LESS_THAN:
                taskQuery.processVariableValueLessThan(variable.getName(), actualValue);
                break;

            case LESS_THAN_OR_EQUALS:
                taskQuery.processVariableValueLessThanOrEqual(variable.getName(), actualValue);
                break;

            case LIKE:
                if (actualValue instanceof String) {
                    taskQuery.processVariableValueLike(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) {
                    taskQuery.processVariableValueLikeIgnoreCase(variable.getName(), (String) actualValue);
                } else {
                    throw new FlowableIllegalArgumentException("Only string variable values are supported using like, but was: " + actualValue.getClass().getName());
                }
                break;

            case EXISTS:
                taskQuery.processVariableExists(variable.getName());
                break;

            case NOT_EXISTS:
                taskQuery.processVariableNotExists(variable.getName());
                break;

View on GitHub (pinned to d6d39ce1c6)