{"record":{"id":"3c00bccde21336a6","repo":"flowable/flowable-engine","slug":"category-is-null-3c00bc","errorCode":null,"errorMessage":"category is null","messagePattern":"category is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessDefinitionQueryImpl.java","lineNumber":103,"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 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\");","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessDefinitionQueryImpl.java#L85-L121","documentation":"ProcessDefinitionQueryImpl.processDefinitionCategory() filters process definitions by their exact category (the BPMN targetNamespace-derived category), which must be non-null. A null category cannot form a valid equality filter, so the query throws FlowableIllegalArgumentException eagerly. This is a fail-fast argument validation on the query builder.","triggerScenarios":"Calling ProcessDefinitionQuery.processDefinitionCategory(null), usually when the category is read from an optional request parameter, deployment metadata, or a config value that was never set.","commonSituations":"REST search endpoints forwarding query params verbatim where 'category' was omitted; BPMN files deployed without a targetNamespace so the expected category never exists; copying category values between environments with different configuration.","solutions":["Validate the category value at the entry point and reject the request before building the query.","Guard the call: if (category != null) query.processDefinitionCategory(category);","If category is an optional filter, omit the call rather than passing null.","Verify deployed BPMN resources actually carry the intended category/targetNamespace."],"exampleFix":"// before\nProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionCategory(request.getCategory()); // may be null\n\n// after\nProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();\nif (request.getCategory() != null) {\n    query.processDefinitionCategory(request.getCategory());\n}","handlingStrategy":"validation","validationCode":"if (category == null || category.isEmpty()) {\n    return repositoryService.createProcessDefinitionQuery(); // no category filter\n}\nreturn repositoryService.createProcessDefinitionQuery().processDefinitionCategory(category);","typeGuard":"boolean hasCategory(String category) {\n    return category != null && !category.trim().isEmpty();\n}","tryCatchPattern":"try {\n    return repositoryService.createProcessDefinitionQuery().processDefinitionCategory(category).list();\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Null category filter: {}\", e.getMessage());\n    throw new BadRequestException(\"category must not be null\");\n}","preventionTips":["Treat optional query params as absent (skip the filter) rather than passing null.","Validate required filters at the REST/controller layer before touching Flowable APIs.","Verify BPMN deployments carry the expected targetNamespace/category.","Standardize category values in config shared across environments."],"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"}