{"record":{"id":"3d156e8b2dcd5c29","repo":"flowable/flowable-engine","slug":"categorynotequals-is-null-3d156e","errorCode":null,"errorMessage":"categoryNotEquals is null","messagePattern":"categoryNotEquals is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessDefinitionQueryImpl.java","lineNumber":121,"sourceCode":"            throw new FlowableIllegalArgumentException(\"category is null\");\n        }\n        this.category = category;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionCategoryLike(String categoryLike) {\n        if (categoryLike == null) {\n            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\");","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessDefinitionQueryImpl.java#L103-L139","documentation":"ProcessDefinitionQueryImpl.processDefinitionCategoryNotEquals() excludes definitions whose category equals the given value, which must be non-null. A null exclusion value is meaningless as a filter, so Flowable throws FlowableIllegalArgumentException at call time. This is argument validation on the query builder, not a query execution failure.","triggerScenarios":"Calling processDefinitionCategoryNotEquals(null), typically when the exclusion value comes from an absent request parameter or an unset configuration property.","commonSituations":"Filter UIs where the 'exclude category' field was left blank; generic query-assembler code that calls every setter with values from a map containing null; refactor that replaced a default string with null.","solutions":["Only call the method when a non-null exclusion value exists.","Guard: if (categoryNotEquals != null) query.processDefinitionCategoryNotEquals(categoryNotEquals);","Validate at the API boundary that exclusion filters are non-empty strings.","Skip optional filters instead of passing null placeholders."],"exampleFix":"// before\nProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionCategoryNotEquals(excludeCategory); // may be null\n\n// after\nProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();\nif (excludeCategory != null) {\n    query.processDefinitionCategoryNotEquals(excludeCategory);\n}","handlingStrategy":"validation","validationCode":"if (categoryNotEquals != null && !categoryNotEquals.isEmpty()) {\n    query = repositoryService.createProcessDefinitionQuery().processDefinitionCategoryNotEquals(categoryNotEquals);\n} else {\n    query = repositoryService.createProcessDefinitionQuery();\n}","typeGuard":"boolean hasExclusionValue(String v) {\n    return v != null && !v.trim().isEmpty();\n}","tryCatchPattern":"try {\n    return repositoryService.createProcessDefinitionQuery().processDefinitionCategoryNotEquals(exclude).list();\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Null categoryNotEquals value: {}\", e.getMessage());\n    throw new BadRequestException(\"categoryNotEquals must not be null\");\n}","preventionTips":["Only apply exclusion filters when a real value was supplied.","Reject blank exclusion fields at the UI/API layer.","Avoid generic map-to-setter reflection that forwards null map entries.","Default exclusion lists to empty, and skip the setter when empty."],"tags":["flowable","query-builder","null-check","filter"],"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"}