{"record":{"id":"673dc95b54b0061c","repo":"flowable/flowable-engine","slug":"created-after-time-is-null","errorCode":null,"errorMessage":"created after time is null","messagePattern":"created after time is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-eventsubscription-service/src/main/java/org/flowable/eventsubscription/service/impl/EventSubscriptionQueryImpl.java","lineNumber":379,"sourceCode":"    @Override\n    public EventSubscriptionQueryImpl createdBefore(Date beforeTime) {\n        if (beforeTime == null) {\n            throw new FlowableIllegalArgumentException(\"created before time is null\");\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.createdBefore = beforeTime;\n        } else {\n            this.createdBefore = beforeTime;\n        }\n\n        return this;\n    }\n\n    @Override\n    public EventSubscriptionQueryImpl createdAfter(Date afterTime) {\n        if (afterTime == null) {\n            throw new FlowableIllegalArgumentException(\"created after time is null\");\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.createdAfter = afterTime;\n        } else {\n            this.createdAfter = afterTime;\n        }\n\n        return this;\n    }\n\n    @Override\n    public EventSubscriptionQueryImpl tenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"tenant id is null\");\n        }\n\n        if (inOrStatement) {","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-eventsubscription-service/src/main/java/org/flowable/eventsubscription/service/impl/EventSubscriptionQueryImpl.java#L361-L397","documentation":"EventSubscriptionQueryImpl.createdAfter() requires a non-null java.util.Date start boundary. Flowable throws FlowableIllegalArgumentException when the after-time is null, since null cannot form a valid comparison predicate for the created-time column. This is deliberate strict validation on the fluent query API.","triggerScenarios":"Calling eventSubscriptionQuery.createdAfter(null), e.g. a start date derived from an unset process variable, a null request parameter, or a failed date parse.","commonSituations":"Building 'subscriptions created since X' queries where X is optional; timezone/date parsing helpers that return null on unparseable input.","solutions":["Ensure the start date is non-null before calling createdAfter(), using a sensible default (e.g. epoch or now-minus-window)","Only call createdAfter() when a start boundary applies","Fix the date source/parsing so it never yields null"],"exampleFix":"// before\nquery.createdAfter(sinceDate);\n\n// after\nif (sinceDate != null) {\n    query.createdAfter(sinceDate);\n} else {\n    query.createdAfter(Date.from(Instant.now().minus(Duration.ofDays(7))));\n}","handlingStrategy":"validation","validationCode":"if (afterTime == null) {\n    throw new IllegalArgumentException(\"createdAfter requires a start date\");\n}","typeGuard":"boolean validDate(Date d) { return d != null && d.after(new Date(0)); }","tryCatchPattern":"try {\n    query.createdAfter(afterTime);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"createdAfter null\", e);\n}","preventionTips":["Only call date-criteria setters when the boundary is present","Provide explicit defaults for time windows","Validate request parameters before constructing queries"],"tags":["flowable","query","null-check","date"],"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"}