{"record":{"id":"ba49cc6ad5c50777","repo":"flowable/flowable-engine","slug":"name-is-empty","errorCode":null,"errorMessage":"name is empty","messagePattern":"name is empty","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/InternalVariableInstanceQueryImpl.java","lineNumber":194,"sourceCode":"    @Override\n    public InternalVariableInstanceQuery scopeType(String scopeType) {\n        if (StringUtils.isEmpty(scopeType)) {\n            throw new FlowableIllegalArgumentException(\"scopeType is empty\");\n        }\n        this.scopeType = scopeType;\n        return this;\n    }\n\n    @Override\n    public InternalVariableInstanceQuery scopeTypes(Collection<String> scopeTypes) {\n        this.scopeTypes = scopeTypes;\n        return this;\n    }\n\n    @Override\n    public InternalVariableInstanceQuery name(String name) {\n        if (StringUtils.isEmpty(name)) {\n            throw new FlowableIllegalArgumentException(\"name is empty\");\n        }\n        this.name = name;\n        return this;\n    }\n\n    @Override\n    public InternalVariableInstanceQuery names(Collection<String> names) {\n        this.names = names;\n        return this;\n    }\n\n    @Override\n    public List<VariableInstanceEntity> list() {\n        return dataManager.findVariablesInstancesByQuery(this);\n    }\n\n    @Override\n    public VariableInstanceEntity singleResult() {","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/InternalVariableInstanceQueryImpl.java#L176-L212","documentation":"InternalVariableInstanceQueryImpl.name(String) requires a non-empty variable name because variables are looked up by their name column. An empty name cannot identify a variable, so FlowableIllegalArgumentException(\"name is empty\") is thrown at InternalVariableInstanceQueryImpl.java:194.","triggerScenarios":"Calling query.name(\"\") or query.name(null); StringUtils.isEmpty triggers the exception.","commonSituations":"Variable name sourced from user input, a map key, or a constant that was never initialized; loops iterating over a variable-name list containing an empty entry.","solutions":["Pass the actual variable name, e.g. query.name(\"orderStatus\").","Filter empty names out of the list before adding name(...) calls.","Skip the name(...) call (or use nameLike with a valid pattern) when the name is unknown."],"exampleFix":"// before\nfor (String n : names) {\n    query.name(n); // throws if n is \"\"\n}\n\n// after\nfor (String n : names) {\n    if (StringUtils.isNotEmpty(n)) {\n        query.name(n);\n    }\n}","handlingStrategy":"validation","validationCode":"if (variableName == null || variableName.isEmpty()) {\n    throw new IllegalArgumentException(\"variableName must be non-empty\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    query.name(variableName);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Skipping empty variable name filter\");\n}","preventionTips":["Filter empty entries out of variable-name lists before querying.","Source variable names from constants/enums where possible.","Validate user-supplied variable names at the API boundary."],"tags":["query","validation","empty-string"],"backgroundTag":"empty-required-field","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"}