{"record":{"id":"8260693855280e9e","repo":"flowable/flowable-engine","slug":"entrycriterionid-is-null","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/history/HistoricPlanItemInstanceQueryImpl.java","lineNumber":307,"sourceCode":"            this.referenceId = referenceId;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricPlanItemInstanceQuery planItemInstanceReferenceType(String referenceType) {\n        if (inOrStatement) {\n            this.currentOrQueryObject.referenceType = referenceType;\n        } else {\n            this.referenceType = referenceType;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricPlanItemInstanceQuery 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 HistoricPlanItemInstanceQuery 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":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricPlanItemInstanceQueryImpl.java#L289-L325","documentation":"HistoricPlanItemInstanceQueryImpl.planItemInstanceEntryCriterionId() rejects a null entryCriterionId with FlowableIllegalArgumentException. Filtering historic plan items by entry criterion requires the criterion's concrete element id.","triggerScenarios":"Calling planItemInstanceEntryCriterionId(null), often from a plan-item/model lookup (e.g. criteria map lookup) that returned null.","commonSituations":"Resolving entry criterion ids from CMMN model XML where the referenced criterion does not exist; variables extracted from case model parsing failing to resolve.","solutions":["Null-check the id before calling and skip the filter when null","Pass the correct entry criterion element id from the CMMN model","Verify the criterion id exists in the deployed case definition before querying","Use planItemInstanceExitCriterionId instead if you meant the exit criterion"],"exampleFix":"// before\nquery.planItemInstanceEntryCriterionId(criterionId).list();\n// after\nif (criterionId != null) {\n    query.planItemInstanceEntryCriterionId(criterionId);\n}\nList<HistoricPlanItemInstance> results = query.list();","handlingStrategy":"validation","validationCode":"if (entryCriterionId != null) {\n    query.planItemInstanceEntryCriterionId(entryCriterionId);\n}","typeGuard":"boolean hasCriterion(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try {\n    query.planItemInstanceEntryCriterionId(criterionId);\n} catch (FlowableIllegalArgumentException e) {\n    if (!e.getMessage().contains(\"EntryCriterionId is null\")) throw e;\n    // proceed without the criterion filter\n}","preventionTips":["Resolve criterion ids from the CMMN model and null-check before filtering","Verify referenced criteria exist in the deployed case definition","Prefer explicit constants for criterion ids over dynamic lookups that can return null"],"tags":["flowable","cmmn","query-api","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-14T16:17:12.679Z"}