flowable/flowable-engine · error · FlowableIllegalArgumentException

disabledAfter is null

Error message

disabledAfter is null

What it means

planItemInstanceLastDisabledAfter(Date) throws FlowableIllegalArgumentException 'disabledAfter is null' if the supplied Date is null. The check lives directly in the builder method of PlanItemInstanceQueryImpl (both the normal and OR-query paths expect a real Date). Flowable rejects null because it cannot form a date comparison.

Solutions

  1. Provide a valid Date argument.
  2. Guard with if (date != null) before chaining the filter.
  3. Default the missing date at the input boundary.
  4. Handle FlowableIllegalArgumentException and rebuild without the filter.

Example fix

// before
query.planItemInstanceLastDisabledAfter(rawFilter); // null
// after
if (rawFilter != null) {
    query.planItemInstanceLastDisabledAfter(rawFilter);
}
Defensive patterns

Strategy: validation

Validate before calling

if (disabledAfter == null) {
    throw new IllegalArgumentException("disabledAfter requires a non-null Date");
}
query.planItemInstanceLastDisabledAfter(disabledAfter);

Type guard

boolean isValidBound(Date d) { return d != null; }

Try / catch

try {
    query.planItemInstanceLastDisabledAfter(disabledAfter);
} catch (FlowableIllegalArgumentException e) {
    query = cmmnRuntimeService.createPlanItemInstanceQuery();
}

Prevention

When it happens

Trigger: Invoking planItemInstanceLastDisabledAfter(null), typically from an unset filter variable or an unmapped request attribute passed straight into the query.

Common situations: Optional 'disabledAfter' filter in admin UIs; batch scripts iterating filters where one entry lacks a date; null results from Calendar-to-Date conversions; API version changes altering payload field names.

Related errors


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

Appendix: source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java:454

    }

    @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;
        }
        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;

View on GitHub (pinned to d6d39ce1c6)