{"record":{"id":"2a00435bf172aa79","repo":"flowable/flowable-engine","slug":"entrycriterionid-is-null-2a0043","errorCode":null,"errorMessage":"EntryCriterionId is null","messagePattern":"EntryCriterionId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java","lineNumber":795,"sourceCode":"            this.completable = true;\n        }\n        return this;\n    }\n    \n    @Override\n    public PlanItemInstanceQuery onlyStages() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.onlyStages = true;\n        } else {\n            this.onlyStages = true;\n        }\n        return this;\n    }\n\n    @Override\n    public PlanItemInstanceQuery planItemInstanceEntryCriterionId(String entryCriterionId) {\n        if (entryCriterionId == null) {\n            throw new FlowableIllegalArgumentException(\"EntryCriterionId is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.entryCriterionId = entryCriterionId;\n        } else {\n            this.entryCriterionId = entryCriterionId;\n        }\n        return this;\n    }\n\n    @Override\n    public PlanItemInstanceQuery planItemInstanceExitCriterionId(String exitCriterionId) {\n        if (exitCriterionId == null) {\n            throw new FlowableIllegalArgumentException(\"ExitCriterionId is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.exitCriterionId = exitCriterionId;\n        } else {\n            this.exitCriterionId = exitCriterionId;","sourceCodeStart":777,"sourceCodeEnd":813,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java#L777-L813","documentation":"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.","triggerScenarios":"Calling planItemInstanceEntryCriterionId(null), e.g. when the criterion id is read from a case definition or model element that lacks an entry criterion.","commonSituations":"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.","solutions":["Null-check the criterion id and only call the setter when a real id exists","If 'no entry criterion' is the intent, omit the criterion or use an isNull-style query option if available","Validate model/definition parsing so absent criteria yield a sentinel value you handle explicitly","Catch FlowableIllegalArgumentException around introspection-driven query building"],"exampleFix":"// before\nquery.planItemInstanceEntryCriterionId(entryCriterionId); // throws when null\n// after\nif (entryCriterionId != null) {\n    query.planItemInstanceEntryCriterionId(entryCriterionId);\n}","handlingStrategy":"validation","validationCode":"if (entryCriterionId != null) {\n    query.planItemInstanceEntryCriterionId(entryCriterionId);\n}","typeGuard":"boolean hasEntryCriterion = entryCriterionId != null;","tryCatchPattern":"try {\n    query.planItemInstanceEntryCriterionId(entryCriterionId);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"entryCriterionId was null, filter skipped\");\n}","preventionTips":["Entry criteria are optional in CMMN models; always guard ids copied from model elements","Normalize model parsing to distinguish 'absent' from a value","Conditionally chain criterion filters in generic introspection code"],"tags":["flowable","cmmn","query","null-argument"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}