flowable/flowable-engine · error · FlowableIllegalArgumentException

created after time is null

Error message

created after time is null

What it means

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.

Solutions

  1. Ensure the start date is non-null before calling createdAfter(), using a sensible default (e.g. epoch or now-minus-window)
  2. Only call createdAfter() when a start boundary applies
  3. Fix the date source/parsing so it never yields null

Example fix

// before
query.createdAfter(sinceDate);

// after
if (sinceDate != null) {
    query.createdAfter(sinceDate);
} else {
    query.createdAfter(Date.from(Instant.now().minus(Duration.ofDays(7))));
}
Defensive patterns

Strategy: validation

Validate before calling

if (afterTime == null) {
    throw new IllegalArgumentException("createdAfter requires a start date");
}

Type guard

boolean validDate(Date d) { return d != null && d.after(new Date(0)); }

Try / catch

try {
    query.createdAfter(afterTime);
} catch (FlowableIllegalArgumentException e) {
    log.warn("createdAfter null", e);
}

Prevention

When it happens

Trigger: Calling eventSubscriptionQuery.createdAfter(null), e.g. a start date derived from an unset process variable, a null request parameter, or a failed date parse.

Common situations: Building 'subscriptions created since X' queries where X is optional; timezone/date parsing helpers that return null on unparseable input.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/673dc95b54b0061c. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-eventsubscription-service/src/main/java/org/flowable/eventsubscription/service/impl/EventSubscriptionQueryImpl.java:379

    @Override
    public EventSubscriptionQueryImpl createdBefore(Date beforeTime) {
        if (beforeTime == null) {
            throw new FlowableIllegalArgumentException("created before time is null");
        }

        if (inOrStatement) {
            this.currentOrQueryObject.createdBefore = beforeTime;
        } else {
            this.createdBefore = beforeTime;
        }

        return this;
    }

    @Override
    public EventSubscriptionQueryImpl createdAfter(Date afterTime) {
        if (afterTime == null) {
            throw new FlowableIllegalArgumentException("created after time is null");
        }

        if (inOrStatement) {
            this.currentOrQueryObject.createdAfter = afterTime;
        } else {
            this.createdAfter = afterTime;
        }

        return this;
    }

    @Override
    public EventSubscriptionQueryImpl tenantId(String tenantId) {
        if (tenantId == null) {
            throw new FlowableIllegalArgumentException("tenant id is null");
        }

        if (inOrStatement) {

View on GitHub (pinned to d6d39ce1c6)