{"record":{"id":"e9eaa16922a788d3","repo":"flowable/flowable-engine","slug":"category-is-null-e9eaa1","errorCode":null,"errorMessage":"category is null","messagePattern":"category is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java","lineNumber":96,"sourceCode":"        super(commandExecutor);\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionId(String processDefinitionId) {\n        this.id = processDefinitionId;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQuery processDefinitionIds(Set<String> processDefinitionIds) {\n        this.ids = processDefinitionIds;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionCategory(String category) {\n        if (category == null) {\n            throw new ActivitiIllegalArgumentException(\"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 ActivitiIllegalArgumentException(\"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 ActivitiIllegalArgumentException(\"categoryNotEquals is null\");","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java#L78-L114","documentation":"ProcessDefinitionQueryImpl.processDefinitionCategory(String) filters process definitions by their exact category (the BPMN targetNamespace/category metadata). Flowable throws ActivitiIllegalArgumentException when the category is null, since a null equality filter is meaningless in the query layer.","triggerScenarios":"Calling processDefinitionQuery.processDefinitionCategory(null), often when the category is read from a BPMN model attribute or config that is absent.","commonSituations":"Deployed BPMN XML lacking a category and code assuming it exists; passing a map lookup result (map.get(\"category\")) straight into the query.","solutions":["Pass a non-null category string that matches deployed definitions.","Null-check the category before applying the filter; skip processDefinitionCategory() when filtering isn't needed.","Verify the deployed BPMN XML actually declares the expected category.","Catch ActivitiIllegalArgumentException around the query to return a user-friendly message."],"exampleFix":"// before\nquery.processDefinitionCategory(attributes.get(\"category\")); // may be null\n// after\nString category = attributes.get(\"category\");\nif (category != null) {\n    query.processDefinitionCategory(category);\n}","handlingStrategy":"validation","validationCode":"if (category != null && !category.isEmpty()) {\n    query.processDefinitionCategory(category);\n}","typeGuard":"boolean hasCategory(String c) { return c != null && !c.isEmpty(); }","tryCatchPattern":"try {\n    query.processDefinitionCategory(category);\n} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {\n    throw new BadRequestException(\"category filter must not be null\", e);\n}","preventionTips":["Verify deployed BPMN resources declare the category you filter on.","Null-check map/config lookups before using them as filter values.","Omit filters that have no value rather than passing null."],"tags":["activiti","flowable","process-definition","null-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-14T16:17:12.679Z"}