{"record":{"id":"e06fb07503bdd59d","repo":"flowable/flowable-engine","slug":"provided-process-definition-key-is-null-e06fb0","errorCode":null,"errorMessage":"Provided process definition key is null","messagePattern":"Provided process definition key is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java","lineNumber":162,"sourceCode":"    }\n\n    @Override\n    public ExternalWorkerJobQuery processDefinitionId(String processDefinitionId) {\n        if (processDefinitionId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided process definition id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.processDefinitionId = processDefinitionId;\n        } else {\n            this.processDefinitionId = processDefinitionId;\n        }\n        return this;\n    }\n\n    @Override\n    public ExternalWorkerJobQuery 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 ExternalWorkerJobQuery 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;","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java#L144-L180","documentation":"ExternalWorkerJobQuery.processDefinitionKey(String) throws FlowableIllegalArgumentException when the provided process definition key is null. Like the other query filters, Flowable rejects null eagerly so callers cannot accidentally build an invalid query. Provide the BPMN key of the process definition or omit the filter.","triggerScenarios":"Calling externalWorkerJobQuery().processDefinitionKey(null), e.g. when the key comes from a form field, BPMN model attribute, or property file that is empty/null.","commonSituations":"Generic admin tools that build queries from request parameters where 'processDefinitionKey' is optional; BPMN models with a missing or renamed key attribute; Spring configuration properties not set.","solutions":["Pass the actual process definition key from the BPMN model's process id.","Guard the call site with a null/blank check before adding the filter.","If the key is dynamic, substitute a resolved default key.","Validate request/config inputs before mapping them into query filters."],"exampleFix":"// before\nquery.processDefinitionKey(config.getProcessKey());\n// after\nString key = config.getProcessKey();\nif (key != null && !key.isBlank()) {\n    query.processDefinitionKey(key);\n}","handlingStrategy":"validation","validationCode":"if (processDefinitionKey != null && !processDefinitionKey.isBlank()) {\n    query.processDefinitionKey(processDefinitionKey);\n}","typeGuard":"boolean hasKey(String key) { return key != null && !key.isBlank(); }","tryCatchPattern":"try {\n    query.processDefinitionKey(key);\n} catch (FlowableIllegalArgumentException e) {\n    // proceed without the key filter or fail fast with a clear message\n}","preventionTips":["Read the key from the BPMN model's process id, not from free-form input.","Make process definition keys required fields in your configuration schema.","Test query builders with null/blank inputs to catch eager validations early."],"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"}