{"record":{"id":"77c47a99e5da9f1c","repo":"flowable/flowable-engine","slug":"process-definition-category-is-null-77c47a","errorCode":null,"errorMessage":"Process definition category is null","messagePattern":"Process definition category is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java","lineNumber":308,"sourceCode":"            this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase;\n        }\n        return this;\n    }\n\n    @Override\n    public ProcessInstanceQuery processInstanceWithoutTenantId() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.withoutTenantId = true;\n        } else {\n            this.withoutTenantId = true;\n        }\n        return this;\n    }\n\n    @Override\n    public ProcessInstanceQuery processDefinitionCategory(String processDefinitionCategory) {\n        if (processDefinitionCategory == null) {\n            throw new FlowableIllegalArgumentException(\"Process definition category is null\");\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.processDefinitionCategory = processDefinitionCategory;\n        } else {\n            this.processDefinitionCategory = processDefinitionCategory;\n        }\n        return this;\n    }\n    \n    @Override\n    public ProcessInstanceQuery processDefinitionCategoryLike(String processDefinitionCategoryLike) {\n        if (processDefinitionCategoryLike == null) {\n            throw new FlowableIllegalArgumentException(\"Process definition category is null\");\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.processDefinitionCategoryLike = processDefinitionCategoryLike;","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java#L290-L326","documentation":"processDefinitionCategory(String) throws FlowableIllegalArgumentException 'Process definition category is null' when the category argument is null. The category filter (set on deployed process definitions) is validated eagerly so bad queries fail at construction. Pass an empty string only if you truly mean category equals empty; otherwise omit the call.","triggerScenarios":"Calling processDefinitionCategory(null), often with a category read from configuration, a deployment descriptor, or an optional request filter.","commonSituations":"Config property for the category missing (null placeholder); optional filter field in a UI passed unguarded; refactoring where the category constant was removed.","solutions":["Call the setter only when the category is non-null.","Fix configuration so a valid category is supplied (e.g. default category in application config).","Remove the criterion when filtering by category is not needed."],"exampleFix":"// before\nquery.processDefinitionCategory(category);\n// after\nif (category != null) {\n    query.processDefinitionCategory(category);\n}","handlingStrategy":"validation","validationCode":"if (processDefinitionCategory == null) {\n    throw new IllegalArgumentException(\"processDefinitionCategory must be non-null when filtering by category\");\n}","typeGuard":"boolean hasCategory(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.processDefinitionCategory(category);\n} catch (FlowableIllegalArgumentException e) {\n    if (!e.getMessage().contains(\"category is null\")) throw e;\n    log.warn(\"No category configured; removing category filter\");\n}","preventionTips":["Default the category in configuration instead of leaving it null.","Guard optional category filters from request parameters.","Only pass empty string if equality against '' is truly intended."],"tags":["flowable","null-check","query-api","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-14T05:17:10.506Z"}