flowable/flowable-engine · error · FlowableIllegalArgumentException
activatedBefore is null
Error message
activatedBefore is null
What it means
planItemInstanceLastStartedBefore(Date) validates its startedBefore argument and throws FlowableIllegalArgumentException with message 'activatedBefore is null' when null is passed. Note the message predates a rename: the parameter is now startedBefore but the error text still says activatedBefore. Null filters are rejected in the builder so queries fail fast.
Solutions
- Pass a non-null Date to planItemInstanceLastStartedBefore.
- Skip the filter call when the date is absent.
- Coalesce null to a default date before building the query.
- If the message confuses you, confirm the actual parameter name (startedBefore) in the Flowable version you use, then apply a null check.
Example fix
// before
query.planItemInstanceLastStartedBefore(null); // throws 'activatedBefore is null'
// after
if (startedBefore != null) {
query.planItemInstanceLastStartedBefore(startedBefore);
} Defensive patterns
Strategy: validation
Validate before calling
if (startedBefore == null) {
throw new IllegalArgumentException("startedBefore must be a non-null Date (error message may still say activatedBefore)");
}
query.planItemInstanceLastStartedBefore(startedBefore); Type guard
boolean hasBound(Date d) { return d != null; } Try / catch
try {
query.planItemInstanceLastStartedBefore(startedBefore);
} catch (FlowableIllegalArgumentException e) {
query = cmmnRuntimeService.createPlanItemInstanceQuery();
} Prevention
- Remember the message text says 'activatedBefore' even though the parameter is startedBefore
- Always null-check before calling date-filter builders
- Update old activated/started naming during migrations
- Verify filter parameters against the Flowable version's API docs
When it happens
Trigger: Calling planItemInstanceLastStartedBefore(null) on a PlanItemInstanceQuery; also seen when code was migrated from the older activatedBefore-named API and the message text no longer matches the parameter.
Common situations: Migrations from older Flowable versions where the method was renamed from activated/started terminology; optional start-date filters left null by form handling; null from a scheduler's 'last run' lookup.
Related errors
- completedBefore is null
- disabledAfter is null
- disabledBefore is null
- enabledAfter is null
- enabledBefore is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/38417317d5ef3898.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java:467
}
@Override
public PlanItemInstanceQuery planItemInstanceLastDisabledAfter(Date disabledAfter) {
if (disabledAfter == null) {
throw new FlowableIllegalArgumentException("disabledAfter is null");
}
if (inOrStatement) {
this.currentOrQueryObject.lastDisabledAfter = disabledAfter;
} else {
this.lastDisabledAfter = disabledAfter;
}
return this;
}
@Override
public PlanItemInstanceQuery planItemInstanceLastStartedBefore(Date startedBefore) {
if (startedBefore == null) {
throw new FlowableIllegalArgumentException("activatedBefore is null");
}
if (inOrStatement) {
this.currentOrQueryObject.lastStartedBefore = startedBefore;
} else {
this.lastStartedBefore = startedBefore;
}
return this;
}
@Override
public PlanItemInstanceQuery planItemInstanceLastStartedAfter(Date startedAfter) {
if (startedAfter == null) {
throw new FlowableIllegalArgumentException("startedAfter is null");
}
if (inOrStatement) {
this.currentOrQueryObject.lastStartedAfter = startedAfter;
} else {
this.lastStartedAfter = startedAfter;View on GitHub (pinned to d6d39ce1c6)