{"record":{"id":"0d7d171e1b387e2b","repo":"flowable/flowable-engine","slug":"only-string-variable-values-are-supported-using-li-0d7d17","errorCode":null,"errorMessage":"Only string variable values are supported using like, but was: ","messagePattern":"Only string variable values are supported using like, but was: ","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskBaseResource.java","lineNumber":551,"sourceCode":"                break;\n\n            case GREATER_THAN_OR_EQUALS:\n                taskQuery.processVariableValueGreaterThanOrEqual(variable.getName(), actualValue);\n                break;\n\n            case LESS_THAN:\n                taskQuery.processVariableValueLessThan(variable.getName(), actualValue);\n                break;\n\n            case LESS_THAN_OR_EQUALS:\n                taskQuery.processVariableValueLessThanOrEqual(variable.getName(), actualValue);\n                break;\n\n            case LIKE:\n                if (actualValue instanceof String) {\n                    taskQuery.processVariableValueLike(variable.getName(), (String) actualValue);\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported using like, but was: \" + actualValue.getClass().getName());\n                }\n                break;\n\n            case LIKE_IGNORE_CASE:\n                if (actualValue instanceof String) {\n                    taskQuery.processVariableValueLikeIgnoreCase(variable.getName(), (String) actualValue);\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported using like, but was: \" + actualValue.getClass().getName());\n                }\n                break;\n\n            case EXISTS:\n                taskQuery.processVariableExists(variable.getName());\n                break;\n\n            case NOT_EXISTS:\n                taskQuery.processVariableNotExists(variable.getName());\n                break;","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskBaseResource.java#L533-L569","documentation":"Flowable's REST task query API throws FlowableIllegalArgumentException when a process-variable predicate uses LIKE with a non-String value. SQL-style pattern matching is only defined for strings, so numeric/boolean/date values are rejected while constructing the TaskQuery.","triggerScenarios":"Task query REST call with a processVariable whose variableOperation is LIKE and whose value is not a String (e.g. an integer or boolean pattern value).","commonSituations":"Building pattern queries programmatically where the value kept its native JSON type, or sending patterns like 12% as a number instead of a quoted string.","solutions":["Quote the value in JSON so it is a String (value: \"12%\" not value: 12).","Use EQUALS (or GREATER_THAN etc.) for non-String variables instead of LIKE.","Convert the pattern to a String on the client before submitting.","Validate request payloads client-side to ensure LIKE variables are strings."],"exampleFix":"// before\n{\"processVariable\": \"orderNumber\", \"variableOperation\": \"LIKE\", \"value\": 42}\n// after\n{\"processVariable\": \"orderNumber\", \"variableOperation\": \"LIKE\", \"value\": \"42%\"}","handlingStrategy":"validation","validationCode":"if (variable.getValue() != null && !(variable.getValue() instanceof String)) {\n    throw new IllegalArgumentException(\"LIKE requires a String pattern for variable \" + variable.getName());\n}","typeGuard":"function isStringVar(v) { return typeof v.value === 'string'; }","tryCatchPattern":"try {\n    // task query call\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"Only string variable values are supported using like\")) {\n        // resend with String pattern or switch operation\n    } else throw e;\n}","preventionTips":["Always quote LIKE patterns in JSON","Use type-supported operations for non-String variables","Validate LIKE operands are strings before sending"],"tags":["rest-api","validation","flowable","type-mismatch"],"backgroundTag":"invalid-argument-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}