{"record":{"id":"e7ae73e841dc922e","repo":"flowable/flowable-engine","slug":"only-string-variable-values-are-supported-for-like-e7ae73","errorCode":null,"errorMessage":"Only string variable values are supported for like, but was: \" + actualValue.getClass().getName()","messagePattern":"Only string variable values are supported for like, but was: \" \\+ actualValue\\.getClass\\(\\)\\.getName\\(\\)","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseProcessInstanceResource.java","lineNumber":332,"sourceCode":"                break;\n\n            case NOT_EQUALS:\n                processInstanceQuery.variableValueNotEquals(variable.getName(), actualValue);\n                break;\n\n            case NOT_EQUALS_IGNORE_CASE:\n                if (actualValue instanceof String) {\n                    processInstanceQuery.variableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported when ignoring casing, but was: \" + actualValue.getClass().getName());\n                }\n                break;\n\n            case LIKE:\n                if (actualValue instanceof String) {\n                    processInstanceQuery.variableValueLike(variable.getName(), (String) actualValue);\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported for like, but was: \" + actualValue.getClass().getName());\n                }\n                break;\n\n            case LIKE_IGNORE_CASE:\n                if (actualValue instanceof String) {\n                    processInstanceQuery.variableValueLikeIgnoreCase(variable.getName(), (String) actualValue);\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported for like, but was: \" + actualValue.getClass().getName());\n                }\n                break;\n\n            case GREATER_THAN:\n                processInstanceQuery.variableValueGreaterThan(variable.getName(), actualValue);\n                break;\n\n            case GREATER_THAN_OR_EQUALS:\n                processInstanceQuery.variableValueGreaterThanOrEqual(variable.getName(), actualValue);\n                break;","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseProcessInstanceResource.java#L314-L350","documentation":"addVariables throws this FlowableIllegalArgumentException when the LIKE variable query operation is used with a non-String value. SQL LIKE matching is a string operation, so Flowable requires the actualValue to be a String before calling processInstanceQuery.variableValueLike.","triggerScenarios":"Process-instance query with variableOperation=LIKE and a value that is a number, boolean, or other non-string type (e.g. {\"value\":123,\"operation\":\"like\"}).","commonSituations":"Users forgetting that LIKE patterns must be strings, e.g. sending 123 instead of \"123%\"; Swagger clients preserving the numeric type from a previous query; building queries programmatically from untyped maps.","solutions":["Send the LIKE pattern as a JSON string, including wildcards like \"%\" where intended","Use EQUALS for exact non-string matches","Cast the value to a string in your client before building the request"],"exampleFix":"// before\n{\"name\":\"count\",\"value\":100,\"operation\":\"like\"}\n// after\n{\"name\":\"count\",\"value\":\"100%\",\"operation\":\"like\"}","handlingStrategy":"validation","validationCode":"if (operation === 'like' && typeof value !== 'string') throw new Error('like requires a string pattern, got: ' + typeof value);","typeGuard":"function isLikeReady(v) { return typeof v === 'string'; }","tryCatchPattern":"try { await query(queryBody); } catch (e) { if (e.message.includes('supported for like')) { /* fall back to EQUALS with the raw typed value */ } }","preventionTips":["Always include wildcard characters (%) in a string pattern","Never reuse a numeric value object across LIKE operations","Add a client-side schema that types 'like' values as string"],"tags":["flowable","rest-api","query","like","type-mismatch"],"backgroundTag":"type-mismatch","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"}