{"record":{"id":"2b43b4d5b967860a","repo":"flowable/flowable-engine","slug":"provided-job-id-is-null-2b43b4","errorCode":null,"errorMessage":"Provided job id is null","messagePattern":"Provided job id is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/TimerJobQueryImpl.java","lineNumber":98,"sourceCode":"    protected boolean inOrStatement;\n\n    public TimerJobQueryImpl() {\n    }\n\n    public TimerJobQueryImpl(CommandContext commandContext, JobServiceConfiguration jobServiceConfiguration) {\n        super(commandContext);\n        this.jobServiceConfiguration = jobServiceConfiguration;\n    }\n\n    public TimerJobQueryImpl(CommandExecutor commandExecutor, JobServiceConfiguration jobServiceConfiguration) {\n        super(commandExecutor);\n        this.jobServiceConfiguration = jobServiceConfiguration;\n    }\n\n    @Override\n    public TimerJobQueryImpl jobId(String jobId) {\n        if (jobId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided job id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.id = jobId;\n        } else {\n            this.id = jobId;\n        }\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery jobIds(Collection<String> jobIds) {\n        if (jobIds == null) {\n            throw new FlowableIllegalArgumentException(\"Provided job id list is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.jobIds = jobIds;\n        } else {\n            this.jobIds = jobIds;","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/TimerJobQueryImpl.java#L80-L116","documentation":"Flowable's TimerJobQueryImpl.jobId(String) throws FlowableIllegalArgumentException when the caller passes a null job id. The query API validates every filter argument up front so that an invalid query fails fast at build time rather than producing a broken SQL query or silently empty results. Passing null to a single-value filter is never meaningful, so it is rejected unconditionally.","triggerScenarios":"Calling timerJobService.createTimerJobQuery().jobId(null), directly or via wrapper code that forwards an uninitialized/nullable variable.","commonSituations":"Resolving a job id from a optional configuration property, a REST parameter, or a process variable that is unset; refactoring code where the id variable became nullable; passing a lookup result that returned null because the entity does not exist.","solutions":["Ensure the jobId value is populated before building the query (check the source variable/expression for null)","If the job may not exist, guard the query call: only build/run the query when id != null","If you intended a broad query, omit the jobId() filter entirely instead of passing null","Catch FlowableIllegalArgumentException and handle it as invalid input if the id comes from user input"],"exampleFix":"// before\ntimerJobQuery.jobId(variables.get(\"timerJobId\"));\n// after\nString jobId = (String) variables.get(\"timerJobId\");\nif (jobId != null) {\n    timerJobQuery.jobId(jobId);\n}","handlingStrategy":"validation","validationCode":"if (jobId == null) { throw new IllegalArgumentException(\"jobId is required before calling timerJobQuery.jobId()\"); }","typeGuard":"boolean hasJobId(String jobId) { return jobId != null && !jobId.isEmpty(); }","tryCatchPattern":"try { query.jobId(jobId); } catch (FlowableIllegalArgumentException e) { log.warn(\"Invalid job id filter: {}\", e.getMessage()); }","preventionTips":["Null-check ids before applying query filters","Skip filters conditionally instead of passing null to clear them","Wrap query building in a helper that ignores null filter values","Validate ids at API boundaries before they reach service code"],"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"}