{"record":{"id":"9ea94a48ee79178b","repo":"flowable/flowable-engine","slug":"name-is-null-9ea94a","errorCode":null,"errorMessage":"name is null","messagePattern":"name is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessDefinitionQueryImpl.java","lineNumber":130,"sourceCode":"            throw new FlowableIllegalArgumentException(\"categoryLike is null\");\n        }\n        this.categoryLike = categoryLike;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionCategoryNotEquals(String categoryNotEquals) {\n        if (categoryNotEquals == null) {\n            throw new FlowableIllegalArgumentException(\"categoryNotEquals is null\");\n        }\n        this.categoryNotEquals = categoryNotEquals;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionName(String name) {\n        if (name == null) {\n            throw new FlowableIllegalArgumentException(\"name is null\");\n        }\n        this.name = name;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new FlowableIllegalArgumentException(\"nameLike is null\");\n        }\n        this.nameLike = nameLike;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionNameLikeIgnoreCase(String nameLikeIgnoreCase) {\n        if (nameLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"nameLikeIgnoreCase is null\");","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessDefinitionQueryImpl.java#L112-L148","documentation":"ProcessDefinitionQueryImpl.processDefinitionName() filters definitions by their exact name, which must be a non-null String. Passing null would create an invalid equality filter, so the query throws FlowableIllegalArgumentException as soon as the setter is called. The name here refers to the process definition name from the BPMN model, not the key.","triggerScenarios":"Calling processDefinitionName(null), usually when the name is taken from an optional query parameter, a localized label map miss, or config that names processes per environment.","commonSituations":"REST search endpoints forwarding absent 'name' params; i18n lookups returning null for an untranslated process label; environment-specific process-name configuration keys not set.","solutions":["Validate the name before building the query and return a clear client error if missing.","Guard: if (name != null) query.processDefinitionName(name);","If filtering by name is optional, omit the call rather than passing null.","Consider filtering by processDefinitionKey() instead if the value is actually a key."],"exampleFix":"// before\nProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionName(params.get(\"name\")); // may be null\n\n// after\nProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();\nString name = params.get(\"name\");\nif (name != null && !name.isEmpty()) {\n    query.processDefinitionName(name);\n}","handlingStrategy":"validation","validationCode":"if (name == null || name.isEmpty()) {\n    throw new BadRequestException(\"Process definition name is required\");\n}\nList<ProcessDefinition> defs = repositoryService.createProcessDefinitionQuery().processDefinitionName(name).list();","typeGuard":"boolean hasDefinitionName(String name) {\n    return name != null && !name.trim().isEmpty();\n}","tryCatchPattern":"try {\n    return repositoryService.createProcessDefinitionQuery().processDefinitionName(name).list();\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Null process definition name: {}\", e.getMessage());\n    throw new BadRequestException(\"name must not be null\");\n}","preventionTips":["Differentiate name vs key filters; use processDefinitionKey() for keys.","Validate search parameters at the controller before building Flowable queries.","Handle i18n label lookups returning null with explicit fallbacks.","Make optional filters skip the setter instead of passing null."],"tags":["flowable","query-builder","null-check","process-definition"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}