{"record":{"id":"342ed33571d5889f","repo":"flowable/flowable-engine","slug":"provided-element-name-is-null-342ed3","errorCode":null,"errorMessage":"Provided element name is null","messagePattern":"Provided element name is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/SuspendedJobQueryImpl.java","lineNumber":229,"sourceCode":"    }\n\n    @Override\n    public SuspendedJobQueryImpl elementIds(Collection<String> elementIds) {\n        if (elementIds == null) {\n            throw new FlowableIllegalArgumentException(\"Provided element ids are null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.elementIds = elementIds;\n        } else {\n            this.elementIds = elementIds;\n        }\n        return this;\n    }\n    \n    @Override\n    public SuspendedJobQueryImpl elementName(String elementName) {\n        if (elementName == null) {\n            throw new FlowableIllegalArgumentException(\"Provided element name is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.elementName = elementName;\n        } else {\n            this.elementName = elementName;\n        }\n        return this;\n    }\n    \n    @Override\n    public SuspendedJobQueryImpl scopeId(String scopeId) {\n        if (scopeId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided scope id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.scopeId = scopeId;\n        } else {\n            this.scopeId = scopeId;","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/SuspendedJobQueryImpl.java#L211-L247","documentation":"This FlowableIllegalArgumentException is thrown by SuspendedJobQueryImpl.elementName() when the caller passes a null String. Flowable validates query filter arguments eagerly so a bad query fails at configuration time rather than at execution time. A null element name is not treated as 'no filter'; it is rejected as invalid input.","triggerScenarios":"Calling suspendedJobQuery().elementName(null), typically when the name comes from an uninitialized variable, a map lookup that missed, or an optional request parameter bound as null.","commonSituations":"REST request fields left unset and passed straight into the query; configuration lookups returning null for a missing element name; tests passing null to probe behavior.","solutions":["Only call elementName() when the value is non-null","Coalesce to a sentinel value or omit the filter entirely when null","Fix the upstream source so it supplies an empty-string/default instead of null","Validate request input before mapping it to the query"],"exampleFix":"// before\nquery.elementName(elementName); // may be null\n// after\nif (elementName != null) {\n    query.elementName(elementName);\n}","handlingStrategy":"validation","validationCode":"if (elementName != null) {\n    query.elementName(elementName);\n}","typeGuard":"boolean hasElementName = elementName != null && !elementName.trim().isEmpty();","tryCatchPattern":"try {\n    query.elementName(elementName);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"element name is null\")) {\n        // rebuild query without the elementName filter\n    } else {\n        throw e;\n    }\n}","preventionTips":["Default optional name fields to empty string, not null","Sanitize/validate request DTOs before mapping to Flowable queries","Use Objects.requireNonNullElse(value, \"\") only when empty-string semantics are intended","Keep filter application centralized in one guarded helper"],"tags":["java","flowable","query","null-check","validation"],"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"}