{"record":{"id":"3f7d68e1e225a559","repo":"flowable/flowable-engine","slug":"only-string-variable-values-are-supported-for-like","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: (.+?)","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceBaseResource.java","lineNumber":354,"sourceCode":"                break;\n\n            case EQUALS_IGNORE_CASE:\n                if (actualValue instanceof String) {\n                    caseInstanceQuery.variableValueEqualsIgnoreCase(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 NOT_EQUALS:\n                caseInstanceQuery.variableValueNotEquals(variable.getName(), actualValue);\n                break;\n\n            case LIKE:\n                if (actualValue instanceof String) {\n                    caseInstanceQuery.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                    caseInstanceQuery.variableValueLikeIgnoreCase(variable.getName(), (String) actualValue);\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported for like, but was: \"\n                            + actualValue.getClass().getName());\n                }\n                break;\n\n            case GREATER_THAN:\n                caseInstanceQuery.variableValueGreaterThan(variable.getName(), actualValue);\n                break;\n\n            case GREATER_THAN_OR_EQUALS:\n                caseInstanceQuery.variableValueGreaterThanOrEqual(variable.getName(), actualValue);","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceBaseResource.java#L336-L372","documentation":"Guard in HistoricCaseInstanceBaseResource.addVariables for the LIKE operations: SQL LIKE matching only supports string values, but the supplied variable value is of a non-string type (class name in message).","triggerScenarios":"POST query with {\"name\":\"x\",\"operation\":\"like\",\"value\":123} — value resolves to a non-String type.","commonSituations":"Numeric ids passed to like without quotes; client library sends raw numbers; developer expects implicit toString conversion.","solutions":["Send the value as a JSON string: \"value\":\"123\"","Use equals/greaterThan for non-string comparisons instead of like","Include LIKE wildcards (%) in the string value as needed","Coerce the value to string client-side before building the payload"],"exampleFix":"// before\n{\"name\":\"orderId\",\"operation\":\"like\",\"value\":12345}\n// after\n{\"name\":\"orderId\",\"operation\":\"like\",\"value\":\"12345%\"}","handlingStrategy":"type-guard","validationCode":"if (\"like\".equals(op) && !(value instanceof String))\n  throw new IllegalArgumentException(\"like requires a String value\");","typeGuard":"boolean likeValueIsString(Object value) { return value instanceof String; }","tryCatchPattern":"try { ... } catch (FlowableIllegalArgumentException e) {\n  return badRequest(\"LIKE requires a string value\");\n}","preventionTips":["Always send like values as JSON strings","Include % wildcards in the string","Coerce numbers to strings client-side"],"tags":["rest-api","validation","type-mismatch","query"],"backgroundTag":"type-mismatch","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}