flowable/flowable-engine · error · FlowableIllegalArgumentException

EntryCriterionId is null

Error message

EntryCriterionId is null

What it means

PlanItemInstanceQueryImpl.planItemInstanceEntryCriterionId(String) throws FlowableIllegalArgumentException with message "EntryCriterionId is null" when the entryCriterionId argument is null. Entry criterion ids are optional relationships; to filter for instances without one, omit the criterion rather than passing null.

Solutions

  1. Null-check the criterion id and only call the setter when a real id exists
  2. If 'no entry criterion' is the intent, omit the criterion or use an isNull-style query option if available
  3. Validate model/definition parsing so absent criteria yield a sentinel value you handle explicitly
  4. Catch FlowableIllegalArgumentException around introspection-driven query building

Example fix

// before
query.planItemInstanceEntryCriterionId(entryCriterionId); // throws when null
// after
if (entryCriterionId != null) {
    query.planItemInstanceEntryCriterionId(entryCriterionId);
}
Defensive patterns

Strategy: validation

Validate before calling

if (entryCriterionId != null) {
    query.planItemInstanceEntryCriterionId(entryCriterionId);
}

Type guard

boolean hasEntryCriterion = entryCriterionId != null;

Try / catch

try {
    query.planItemInstanceEntryCriterionId(entryCriterionId);
} catch (FlowableIllegalArgumentException e) {
    log.warn("entryCriterionId was null, filter skipped");
}

Prevention

When it happens

Trigger: Calling planItemInstanceEntryCriterionId(null), e.g. when the criterion id is read from a case definition or model element that lacks an entry criterion.

Common situations: Generic CMMN model introspection code that copies criterion ids from plan items where entry criteria are optional; null values from XML/JSON model parsing when a criterion is absent; dynamic dashboards filtering by a user-selected criterion.

Related errors


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

Appendix: source

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

            this.completable = true;
        }
        return this;
    }
    
    @Override
    public PlanItemInstanceQuery onlyStages() {
        if (inOrStatement) {
            this.currentOrQueryObject.onlyStages = true;
        } else {
            this.onlyStages = true;
        }
        return this;
    }

    @Override
    public PlanItemInstanceQuery planItemInstanceEntryCriterionId(String entryCriterionId) {
        if (entryCriterionId == null) {
            throw new FlowableIllegalArgumentException("EntryCriterionId is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.entryCriterionId = entryCriterionId;
        } else {
            this.entryCriterionId = entryCriterionId;
        }
        return this;
    }

    @Override
    public PlanItemInstanceQuery planItemInstanceExitCriterionId(String exitCriterionId) {
        if (exitCriterionId == null) {
            throw new FlowableIllegalArgumentException("ExitCriterionId is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.exitCriterionId = exitCriterionId;
        } else {
            this.exitCriterionId = exitCriterionId;

View on GitHub (pinned to d6d39ce1c6)