flowable/flowable-engine · error · FlowableIllegalArgumentException
disabledBefore is null
Error message
disabledBefore is null
What it means
planItemInstanceLastDisabledBefore(Date) throws FlowableIllegalArgumentException 'disabledBefore is null' when the argument is null. Flowable validates non-null date filters inside the query builder so that malformed criteria are rejected immediately. A null value yields no usable comparison predicate.
Solutions
- Pass a non-null Date to the method.
- Wrap the builder call in a null check and skip the filter when absent.
- Assign a default date when the input is missing.
- Catch FlowableIllegalArgumentException as a last resort and drop the filter.
Example fix
// before
query.planItemInstanceLastDisabledBefore(dto.getDisabledBefore()); // null when not set
// after
if (dto.getDisabledBefore() != null) {
query.planItemInstanceLastDisabledBefore(dto.getDisabledBefore());
} Defensive patterns
Strategy: validation
Validate before calling
if (disabledBefore == null) {
throw new IllegalArgumentException("disabledBefore must be a non-null Date");
}
query.planItemInstanceLastDisabledBefore(disabledBefore); Type guard
boolean nonNull(Date d) { return d != null; } Try / catch
try {
query.planItemInstanceLastDisabledBefore(disabledBefore);
} catch (FlowableIllegalArgumentException e) {
query = cmmnRuntimeService.createPlanItemInstanceQuery();
} Prevention
- Apply date filters only when the bound exists
- Make filter mapping code reject or skip nulls explicitly
- Document which query filters are mandatory vs optional
- Add regression tests for absent filter fields
When it happens
Trigger: Calling createPlanItemInstanceQuery().planItemInstanceLastDisabledBefore(null) — commonly because the disabledBefore field on a filter DTO was never populated.
Common situations: Report builders composing many optional date filters where one is left null; JSON request bodies omitting the field; timezone-parsing helpers returning null on bad input; tests exercising null handling.
Related errors
- activatedBefore is null
- completedBefore is null
- disabledAfter is null
- enabledAfter is null
- enabledBefore is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/ce539c949c0f83a4.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java:441
}
@Override
public PlanItemInstanceQuery planItemInstanceLastEnabledAfter(Date enabledAfter) {
if (enabledAfter == null) {
throw new FlowableIllegalArgumentException("enabledAfter is null");
}
if (inOrStatement) {
this.currentOrQueryObject.lastEnabledAfter = enabledAfter;
} else {
this.lastEnabledAfter = enabledAfter;
}
return this;
}
@Override
public PlanItemInstanceQuery planItemInstanceLastDisabledBefore(Date disabledBefore) {
if (disabledBefore == null) {
throw new FlowableIllegalArgumentException("disabledBefore is null");
}
if (inOrStatement) {
this.currentOrQueryObject.lastDisabledBefore = disabledBefore;
} else {
this.lastDisabledBefore = disabledBefore;
}
return this;
}
@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;View on GitHub (pinned to d6d39ce1c6)