{"record":{"id":"95ba376617766aff","repo":"flowable/flowable-engine","slug":"only-string-values-can-be-used-with-equals-ignore","errorCode":null,"errorMessage":"Only string values can be used with 'equals ignore case' condition","messagePattern":"Only string values can be used with 'equals ignore case' condition","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/AbstractVariableQueryImpl.java","lineNumber":319,"sourceCode":"            throw new FlowableIllegalArgumentException(\"name is null\");\n        }\n        if (value == null || isBoolean(value)) {\n            // Null-values and booleans can only be used in EQUALS, NOT_EQUALS, EXISTS and NOT_EXISTS\n            switch (operator) {\n                case GREATER_THAN:\n                    throw new FlowableIllegalArgumentException(\"Booleans and null cannot be used in 'greater than' condition\");\n                case LESS_THAN:\n                    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        }","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/AbstractVariableQueryImpl.java#L301-L337","documentation":"Flowable's EQUALS_IGNORE_CASE comparison only makes sense for string variables; when a non-String value is supplied, addVariable throws this FlowableIllegalArgumentException. Case-insensitive equality is implemented as a SQL lower() comparison, which is only meaningful for text values. The error surfaces at query-construction time.","triggerScenarios":"Calling variableValueEqualsIgnoreCase / scopedVariableValueEqualsIgnoreCase with an Integer, Boolean, Date or null value, e.g. taskVariableValueEqualsIgnoreCase(\"priority\", 5).","commonSituations":"Assuming ignore-case variants are drop-in replacements for equals; value typed as Object from generic code; locale-driven code paths passing non-string inputs.","solutions":["Convert the value to String first (String.valueOf(...)) or use a dedicated string variable","Use plain variableValueEquals for non-string types","Validate value instanceof String before invoking the ignore-case setter","Normalize case in application code and use equals if the value is not a string"],"exampleFix":"// before\nq.variableValueEqualsIgnoreCase(\"level\", 3);\n// after\nq.variableValueEqualsIgnoreCase(\"level\", String.valueOf(3)); // or variableValueEquals for numbers","handlingStrategy":"type-guard","validationCode":"if (!(value instanceof String)) {\n    throw new IllegalArgumentException(\"equalsIgnoreCase requires a String value\");\n}\nquery.variableValueEqualsIgnoreCase(name, (String) value);","typeGuard":"static boolean isString(Object v) {\n    return v instanceof String;\n}","tryCatchPattern":"try {\n    query.variableValueEqualsIgnoreCase(name, value);\n} catch (org.flowable.common.engine.api.FlowableIllegalArgumentException e) {\n    query.variableValueEquals(name, value);\n}","preventionTips":["Only use ignore-case variants for string variables","Convert non-strings explicitly with String.valueOf when intended","Avoid blind find/replace of equals to equalsIgnoreCase","Note variable types next to their names in code"],"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"}