{"record":{"id":"599c8e3548095e2f","repo":"flowable/flowable-engine","slug":"provided-category-is-null","errorCode":null,"errorMessage":"Provided category is null","messagePattern":"Provided category is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/DeadLetterJobQueryImpl.java","lineNumber":174,"sourceCode":"    }\n\n    @Override\n    public DeadLetterJobQueryImpl processDefinitionKey(String processDefinitionKey) {\n        if (processDefinitionKey == null) {\n            throw new FlowableIllegalArgumentException(\"Provided process definition key is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.processDefinitionKey = processDefinitionKey;\n        } else {\n            this.processDefinitionKey = processDefinitionKey;\n        }\n        return this;\n    }\n    \n    @Override\n    public DeadLetterJobQueryImpl category(String category) {\n        if (category == null) {\n            throw new FlowableIllegalArgumentException(\"Provided category is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.category = category;\n        } else {\n            this.category = category;\n        }\n        return this;\n    }\n    \n    @Override\n    public DeadLetterJobQueryImpl categoryLike(String categoryLike) {\n        if (categoryLike == null) {\n            throw new FlowableIllegalArgumentException(\"Provided categoryLike is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.categoryLike = categoryLike;\n        } else {\n            this.categoryLike = categoryLike;","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/DeadLetterJobQueryImpl.java#L156-L192","documentation":"DeadLetterJobQueryImpl.category() throws FlowableIllegalArgumentException when the category parameter is null. Flowable validates query filter arguments at setter time so malformed queries surface immediately instead of failing later in the MyBatis mapping. A null category is not treated as 'no filter'; omitting the call is how you express that.","triggerScenarios":"Calling deadLetterJobQuery().category(null), or forwarding a null category variable obtained from a message/event category, configuration, or request parameter into the query builder.","commonSituations":"Category values read from message definitions or BPMN XML attributes that are absent; REST query endpoints passing optional category fields straight through; copied query code where a category constant was deleted or renamed.","solutions":["Guard the call: only invoke category(...) when the value is non-null","Omit the category filter entirely if null should mean 'all categories'","Normalize input so an absent category becomes an empty skip rather than null","Fix the upstream source (BPMN attribute, config, DTO) that yields the null category"],"exampleFix":"// before\nDeadLetterJobQuery query = jobService.createDeadLetterJobQuery().category(jobCategory);\n\n// after\nDeadLetterJobQuery query = jobService.createDeadLetterJobQuery();\nif (jobCategory != null) {\n    query = query.category(jobCategory);\n}","handlingStrategy":"validation","validationCode":"if (category != null && !category.trim().isEmpty()) {\n    query = query.category(category);\n}","typeGuard":"boolean hasCategory(String category) { return category != null && !category.trim().isEmpty(); }","tryCatchPattern":"try {\n    return jobService.createDeadLetterJobQuery().category(category).list();\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Rejecting dead-letter job query: {}\", e.getMessage());\n    return Collections.emptyList();\n}","preventionTips":["Treat null and 'no filter' as distinct: omit the setter call instead of passing null","Centralize query building in one helper that applies null-safe filter addition","Normalize optional fields from BPMN/XML lookups before use","Add unit tests covering absent optional filter values"],"tags":["flowable","null-argument","query-builder","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-18T11:17:12.947Z"}