{"record":{"id":"8c7bd0883737dc69","repo":"flowable/flowable-engine","slug":"only-string-values-can-be-used-with-like-conditi","errorCode":null,"errorMessage":"Only string values can be used with 'like' condition","messagePattern":"Only string values can be used with 'like' condition","errorType":"validation","errorClass":"org.flowable.common.engine.api.FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/AbstractVariableQueryImpl.java","lineNumber":327,"sourceCode":"                    throw new FlowableIllegalArgumentException(\"Booleans and null cannot be used in 'less than' condition\");\n                case GREATER_THAN_OR_EQUAL:\n                    throw new FlowableIllegalArgumentException(\"Booleans and null cannot be used in 'greater than or equal' condition\");\n                case LESS_THAN_OR_EQUAL:\n                    throw new FlowableIllegalArgumentException(\"Booleans and null cannot be used in 'less than or equal' condition\");\n                default:\n                    break;\n            }\n\n            if (operator == QueryOperator.EQUALS_IGNORE_CASE && !(value instanceof String)) {\n                throw new FlowableIllegalArgumentException(\"Only string values can be used with 'equals ignore case' condition\");\n            }\n\n            if (operator == QueryOperator.NOT_EQUALS_IGNORE_CASE && !(value instanceof String)) {\n                throw new FlowableIllegalArgumentException(\"Only string values can be used with 'not equals ignore case' condition\");\n            }\n\n            if ((operator == QueryOperator.LIKE || operator == QueryOperator.LIKE_IGNORE_CASE) && !(value instanceof String)) {\n                throw new FlowableIllegalArgumentException(\"Only string values can be used with 'like' condition\");\n            }\n        }\n\n        queryVariableValues.add(new QueryVariableValue(name, value, operator, localScope, scopeType));\n    }\n\n    protected boolean isBoolean(Object value) {\n        if (value == null) {\n            return false;\n        }\n        return Boolean.class.isAssignableFrom(value.getClass()) || boolean.class.isAssignableFrom(value.getClass());\n    }\n\n    protected void ensureVariablesInitialized() {\n        if (!queryVariableValues.isEmpty()) {\n            for (QueryVariableValue queryVariableValue : queryVariableValues) {\n                queryVariableValue.initialize(variableValueProvider);\n            }","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/AbstractVariableQueryImpl.java#L309-L345","documentation":"LIKE and LIKE_IGNORE_CASE comparisons in Flowable variable queries require a String value; addVariable throws this FlowableIllegalArgumentException for any other type. SQL LIKE matching is only defined for text variables, so the API rejects non-string operands eagerly.","triggerScenarios":"Calling variableValueLike or variableValueLikeIgnoreCase with a non-String value, e.g. processVariableValueLike(\"code\", 123) or with null.","commonSituations":"Building wildcard searches from numeric IDs; null pattern values from optional UI input; pattern strings concatenated from non-string variables without conversion.","solutions":["Ensure the like pattern is a String including wildcards, e.g. \"%abc%\"","Convert numbers/objects with String.valueOf before calling","Use equals/notEquals for non-string matching","Guard with value instanceof String before invoking the like setter"],"exampleFix":"// before\nq.variableValueLike(\"orderId\", 12345);\n// after\nq.variableValueLike(\"orderId\", \"%12345%\");","handlingStrategy":"type-guard","validationCode":"if (!(pattern instanceof String)) {\n    throw new IllegalArgumentException(\"like requires a String pattern\");\n}\nquery.variableValueLike(name, (String) pattern);","typeGuard":"static boolean isLikePattern(Object v) {\n    return v instanceof String;\n}","tryCatchPattern":"try {\n    query.variableValueLike(name, pattern);\n} catch (org.flowable.common.engine.api.FlowableIllegalArgumentException e) {\n    // fall back to equals with String.valueOf(value)\n}","preventionTips":["Always build like patterns as strings with explicit wildcards","Convert ids/numbers with String.valueOf before matching","Validate patterns for null before querying","Reserve like for text variables only"],"tags":["flowable","validation","string","query"],"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"}