{"record":{"id":"f576ec79fdac64e4","repo":"flowable/flowable-engine","slug":"booleans-and-null-cannot-be-used-in-greater-than-f576ec","errorCode":null,"errorMessage":"Booleans and null cannot be used in 'greater than or equal' condition","messagePattern":"Booleans and null cannot be used in 'greater than or equal' condition","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/AbstractVariableQueryImpl.java","lineNumber":182,"sourceCode":"    @SuppressWarnings(\"unchecked\")\n    public T variableValueLikeIgnoreCase(String name, String value, boolean localScope) {\n        addVariable(name, value, QueryOperator.LIKE_IGNORE_CASE, localScope);\n        return (T) this;\n    }\n\n    private void addVariable(String name, Object value, QueryOperator operator, boolean localScope) {\n        if (name == null) {\n            throw new ActivitiIllegalArgumentException(\"name is null\");\n        }\n        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    }","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/AbstractVariableQueryImpl.java#L164-L200","documentation":"ActivitiIllegalArgumentException thrown by addVariable when a null or Boolean value is used with the GREATER_THAN_OR_EQUAL operator. Null/boolean values only support EQUALS and NOT_EQUALS comparisons, so inclusive lower-bound conditions reject them at build time.","triggerScenarios":"Calling variableValueGreaterThanOrEqual(name, null) or variableValueGreaterThanOrEqual(name, aBoolean), including via generic dynamic query construction.","commonSituations":"Date/number range filters where the lower bound is an unset (null) form field, or a boolean feature flag wired into a range query.","solutions":["Null-check the lower bound and only add the condition when a real value is present.","Replace with variableValueEquals when the value is boolean.","Add upstream type validation so booleans are mapped to EQUALS conditions automatically."],"exampleFix":"// before\nquery.processVariableGreaterThanOrEqual(\"dueDate\", lowerBound);\n// after\nif (lowerBound != null) {\n    query.processVariableGreaterThanOrEqual(\"dueDate\", lowerBound);\n}","handlingStrategy":"type-guard","validationCode":"if (lowerBound != null && !(lowerBound instanceof Boolean)) {\n    query.processVariableGreaterThanOrEqual(name, lowerBound);\n}","typeGuard":"boolean isOrderable(Object v) { return v != null && !(v instanceof Boolean); }","tryCatchPattern":"try {\n    query.processVariableGreaterThanOrEqual(name, lowerBound);\n} catch (ActivitiIllegalArgumentException e) {\n    log.warn(\"Skipping lower-bound filter: {}\", e.getMessage());\n}","preventionTips":["Only add inclusive lower bounds when a real value is present","Use variableValueEquals for boolean flags","Sanitize range-filter inputs at the API boundary"],"tags":["activiti","query","boolean","operator"],"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"}