{"record":{"id":"c775d260d3bbb054","repo":"flowable/flowable-engine","slug":"only-string-values-can-be-used-with-not-equals-ig-c775d2","errorCode":null,"errorMessage":"Only string values can be used with 'not equals ignore case' condition","messagePattern":"Only string values can be used with 'not equals ignore case' condition","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/AbstractVariableQueryImpl.java","lineNumber":192,"sourceCode":"        if (value == null || isBoolean(value)) {\n            // Null-values and booleans can only be used in EQUALS and NOT_EQUALS\n            switch (operator) {\n                case GREATER_THAN:\n                    throw new ActivitiIllegalArgumentException(\"Booleans and null cannot be used in 'greater than' condition\");\n                case LESS_THAN:\n                    throw new ActivitiIllegalArgumentException(\"Booleans and null cannot be used in 'less than' condition\");\n                case GREATER_THAN_OR_EQUAL:\n                    throw new ActivitiIllegalArgumentException(\"Booleans and null cannot be used in 'greater than or equal' condition\");\n                case LESS_THAN_OR_EQUAL:\n                    throw new ActivitiIllegalArgumentException(\"Booleans and null cannot be used in 'less than or equal' condition\");\n            }\n\n            if (operator == QueryOperator.EQUALS_IGNORE_CASE && !(value instanceof String)) {\n                throw new ActivitiIllegalArgumentException(\"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 ActivitiIllegalArgumentException(\"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 ActivitiIllegalArgumentException(\"Only string values can be used with 'like' condition\");\n            }\n        }\n        queryVariableValues.add(new QueryVariableValue(name, value, operator, localScope));\n    }\n\n    private 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()) {","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/AbstractVariableQueryImpl.java#L174-L210","documentation":"ActivitiIllegalArgumentException thrown by addVariable when a NOT_EQUALS_IGNORE_CASE condition receives a non-String value. Case-insensitive inequality is only meaningful for strings because the value is lowercased before comparison; other types (or null, rejected earlier) fail fast at build time.","triggerScenarios":"Calling variableValueNotEqualsIgnoreCase(name, nonStringValue), e.g. with an Integer, Date, or boolean, or via a generic dynamic query layer passing Object values.","commonSituations":"Exclusion filters built from untyped JSON/config input land in the ignore-case method; refactors that switched from equals to equalsIgnoreCase without changing value types.","solutions":["Cast/convert the value to String via String.valueOf(value) before calling.","Use variableValueNotEquals for non-string types.","Add a type check at the query-builder boundary that dispatches string values to ignore-case methods and others to plain equals."],"exampleFix":"// before\nquery.processVariableValueNotEqualsIgnoreCase(\"category\", categoryEnum);\n// after\nquery.processVariableValueNotEqualsIgnoreCase(\"category\", categoryEnum.name());","handlingStrategy":"type-guard","validationCode":"if (value instanceof String) {\n    query.processVariableValueNotEqualsIgnoreCase(name, (String) value);\n} else if (value != null) {\n    query.processVariableValueNotEquals(name, value);\n}","typeGuard":"boolean isString(Object o) { return o instanceof String; }","tryCatchPattern":"try {\n    query.processVariableValueNotEqualsIgnoreCase(name, value);\n} catch (ActivitiIllegalArgumentException e) {\n    log.warn(\"Ignore-case exclusion requires a String: {}\", e.getMessage());\n}","preventionTips":["Use enums' .name() instead of the enum object when filtering case-insensitively","Route non-string values to variableValueNotEquals","Type-check dynamic exclusion filters before applying them"],"tags":["activiti","query","type-mismatch","string"],"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"}