{"record":{"id":"1d8f2e19b5b7f5cd","repo":"flowable/flowable-engine","slug":"name-is-null-1d8f2e","errorCode":null,"errorMessage":"name is null","messagePattern":"name is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/AbstractVariableQueryImpl.java","lineNumber":301,"sourceCode":"    @SuppressWarnings(\"unchecked\")\n    protected T variableNotExists(String name, boolean localScope) {\n        addVariable(name, null, QueryOperator.NOT_EXISTS, localScope);\n        return (T) this;\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    protected T scopedVariableNotExists(String name, String scopeType) {\n        addVariable(name, null, QueryOperator.NOT_EXISTS, scopeType, false);\n        return (T) this;\n    }\n\n    protected void addVariable(String name, Object value, QueryOperator operator, boolean localScope) {\n        this.addVariable(name, value, operator, null, localScope);\n    }\n\n    protected void addVariable(String name, Object value, QueryOperator operator, String scopeType, boolean localScope) {\n        if (name == null) {\n            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\");","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/AbstractVariableQueryImpl.java#L283-L319","documentation":"AbstractVariableQueryImpl.addVariable is the central funnel for all variable criteria; it throws FlowableIllegalArgumentException(\"name is null\") when the variable name is null. A criterion without a name cannot map to any column, so the library fails fast. It also further restricts null/boolean values to EQUALS/NOT_EQUALS/EXISTS-family operators.","triggerScenarios":"Calling any scoped variable criterion (scopedVariableValueEquals, scopedVariableValueEqualsIgnoreCase, scopedVariableValueNotEquals, scopedVariableValueNotEqualsIgnoreCase, scopedVariableValueGreaterThan, scopedVariableValueGreaterThanOrEqual, etc.) with a null variable name.","commonSituations":"Query builders driven by configuration/property maps where the variable name key is missing; refactors that renamed a variable and left the name lookup returning null; framework integrations passing metadata-driven names that may be absent.","solutions":["Null-check the variable name before calling any variableValue* criterion","Skip the criterion when the name is absent, or fail earlier with a clear validation error","Fix the configuration/metadata source that supplies empty variable names","Centralize name resolution in one helper that guarantees non-null input"],"exampleFix":"// before\nquery.scopedVariableValueEquals(nameFromConfig, value, ScopeTypes.PROCESS);\n// after\nif (nameFromConfig != null) {\n    query.scopedVariableValueEquals(nameFromConfig, value, ScopeTypes.PROCESS);\n}","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(name, \"variable name is required\"); query.scopedVariableValueEquals(name, value, scopeType);","typeGuard":"boolean validCriterion(String name, Object value) { return name != null && (value != null || isBoolean(value) == false || true); }","tryCatchPattern":"try { query.scopedVariableValueEquals(name, value, scopeType); } catch (FlowableIllegalArgumentException e) { throw new BadRequestException(\"variable name missing: \" + e.getMessage()); }","preventionTips":["Guarantee variable names are non-null in configuration/metadata before query building","Remember addVariable also forbids null/boolean values with GT/GTE/like operators","Centralize criterion creation in a helper enforcing non-null names"],"tags":["null-argument","query","illegal-argument"],"backgroundTag":"null-argument","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"}