{"record":{"id":"3935587c6338a370","repo":"flowable/flowable-engine","slug":"provided-process-definition-id-is-null-393558","errorCode":null,"errorMessage":"Provided process definition id is null","messagePattern":"Provided process definition id is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TimerJobQueryImpl.java","lineNumber":84,"sourceCode":"            throw new ActivitiIllegalArgumentException(\"Provided job id is null\");\n        }\n        this.id = jobId;\n        return this;\n    }\n\n    @Override\n    public TimerJobQueryImpl processInstanceId(String processInstanceId) {\n        if (processInstanceId == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided process instance id is null\");\n        }\n        this.processInstanceId = processInstanceId;\n        return this;\n    }\n\n    @Override\n    public TimerJobQueryImpl processDefinitionId(String processDefinitionId) {\n        if (processDefinitionId == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided process definition id is null\");\n        }\n        this.processDefinitionId = processDefinitionId;\n        return this;\n    }\n\n    @Override\n    public TimerJobQueryImpl executionId(String executionId) {\n        if (executionId == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided execution id is null\");\n        }\n        this.executionId = executionId;\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery executable() {\n        executable = true;\n        return this;","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TimerJobQueryImpl.java#L66-L102","documentation":"TimerJobQueryImpl.processDefinitionId() throws ActivitiIllegalArgumentException when called with a null process definition id. The Flowable/Activiti query API validates required filter arguments eagerly instead of producing a broken SQL query. Passing null means the caller intended to filter by process definition but supplied no value.","triggerScenarios":"Calling timerJobQuery().processDefinitionId(null) on a TimerJobQuery, typically when the id comes from an uninitialized variable, a failed processDefinitionService lookup, or an optional method parameter that was never set.","commonSituations":"Variable holding the definition id was never populated because the process was not deployed or the lookup returned null; refactored code dropped a default value; mapping an optional REST request parameter straight into the query builder.","solutions":["Pass a non-null process definition id, e.g. managementService.createTimerJobQuery().processDefinitionId(actualId)","If filtering by definition id is optional, guard the call: only invoke processDefinitionId(id) when id != null","Verify the process was deployed and fetch the id via repositoryService.createProcessDefinitionQuery() before querying"],"exampleFix":"// before\nquery.processDefinitionId(processDefinitionId);\n// after\nif (processDefinitionId != null) {\n    query.processDefinitionId(processDefinitionId);\n}","handlingStrategy":"validation","validationCode":"if (processDefinitionId == null || processDefinitionId.isEmpty()) {\n    throw new IllegalStateException(\"processDefinitionId required before querying timer jobs\");\n}\nquery.processDefinitionId(processDefinitionId);","typeGuard":"boolean hasDefinitionId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try {\n    query.processDefinitionId(id);\n} catch (ActivitiIllegalArgumentException e) {\n    log.warn(\"Null process definition id supplied, skipping filter\");\n}","preventionTips":["Resolve the definition id via repositoryService before querying","Only apply optional filters when the value is non-null","Never pass optional request parameters straight into the query builder"],"tags":["flowable","activiti","null-argument","job-query"],"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"}