flowable/flowable-engine · error · FlowableIllegalArgumentException
created before time is null
Error message
created before time is null
What it means
EventSubscriptionQueryImpl.createdBefore() requires a non-null java.util.Date boundary. Flowable throws FlowableIllegalArgumentException when the before-time is null because a null date cannot be translated into a SQL comparison predicate. Query criteria setters are strict about null inputs.
Solutions
- Validate/parse the date before calling createdBefore() and substitute a concrete cutoff (e.g. new Date())
- Skip the createdBefore() call when no end boundary is desired
- Fix date parsing so it cannot silently return null (check parse errors explicitly)
Example fix
// before
query.createdBefore(userProvidedEnd);
// after
if (userProvidedEnd != null) {
query.createdBefore(userProvidedEnd);
} Defensive patterns
Strategy: validation
Validate before calling
if (beforeTime == null) {
beforeTime = new Date();
} Type guard
boolean validDate(Date d) { return d != null && d.after(new Date(0)); } Try / catch
try {
query.createdBefore(beforeTime);
} catch (FlowableIllegalArgumentException e) {
log.warn("createdBefore null", e);
} Prevention
- Default date boundaries before query building
- Fail fast at the API boundary when a required date is missing
- Wrap date parsing so parse failures throw instead of returning null
When it happens
Trigger: Calling eventSubscriptionQuery.createdBefore(null), typically when the cutoff date is computed from a nullable variable, request parameter, or Date parsing that returned null.
Common situations: Building time-window queries where an end date comes from user input or an optional API parameter; SimpleDateFormat.parse failures or unset configuration yielding a null Date.
Related errors
- created after time is null
- Provided token date is null
- Provided tokenDateAfter is null
- Provided tokenDateBefore is null
- activity tenant id is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/453106f06bd6f683.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-eventsubscription-service/src/main/java/org/flowable/eventsubscription/service/impl/EventSubscriptionQueryImpl.java:364
@Override
public EventSubscriptionQueryImpl scopeType(String scopeType) {
if (scopeType == null) {
throw new FlowableIllegalArgumentException("Provided scope type is null");
}
if (inOrStatement) {
this.currentOrQueryObject.scopeType = scopeType;
} else {
this.scopeType = scopeType;
}
return this;
}
@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) {View on GitHub (pinned to d6d39ce1c6)