{"record":{"id":"75e4db887e3a5d08","repo":"flowable/flowable-engine","slug":"rootscopeid-is-null","errorCode":null,"errorMessage":"rootScopeId is null","messagePattern":"rootScopeId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java","lineNumber":409,"sourceCode":"    }\n    \n    @Override\n    public HistoricCaseInstanceQueryImpl caseInstanceBusinessKeyLikeIgnoreCase(String businessKeyLikeIgnoreCase) {\n        if (businessKeyLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"Business key is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.businessKeyLikeIgnoreCase = businessKeyLikeIgnoreCase;\n        } else {\n            this.businessKeyLikeIgnoreCase = businessKeyLikeIgnoreCase;\n        }\n        return this;\n    }\n    \n    @Override\n    public HistoricCaseInstanceQueryImpl caseInstanceRootScopeId(String rootScopeId) {\n        if (rootScopeId == null) {\n            throw new FlowableIllegalArgumentException(\"rootScopeId is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.rootScopeId = rootScopeId;\n        } else {\n            this.rootScopeId = rootScopeId;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricCaseInstanceQuery caseInstanceRootScopeIds(Set<String> rootScopeIds) {\n        if (rootScopeIds == null || rootScopeIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"rootScopeIds is null or empty\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.rootScopeIds = rootScopeIds;\n        } else {\n            this.rootScopeIds = rootScopeIds;","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java#L391-L427","documentation":"caseInstanceRootScopeId(String) throws FlowableIllegalArgumentException('rootScopeId is null') when the root scope id argument is null. The root-scope filter identifies the top-level scope of a case hierarchy and must be a concrete id.","triggerScenarios":"Calling caseInstanceRootScopeId(null), e.g. when the parent/root id was not resolved before querying.","commonSituations":"Hierarchical case queries where the root id comes from a parent entity that is missing or was not loaded; REST filters wired to optional params.","solutions":["Resolve and pass a valid root scope id (e.g. the case instance's root scope id).","Skip the setter when the root id is unknown so the filter is not applied.","Catch FlowableIllegalArgumentException and handle as invalid query input."],"exampleFix":"// before\nquery.caseInstanceRootScopeId(parent.getRootScopeId()); // parent may be null\n// after\nif (parent != null && parent.getRootScopeId() != null) {\n    query.caseInstanceRootScopeId(parent.getRootScopeId());\n}","handlingStrategy":"validation","validationCode":"if (rootScopeId == null) { throw new IllegalArgumentException(\"rootScopeId must not be null\"); }\nhistoricCaseInstanceQuery.caseInstanceRootScopeId(rootScopeId);","typeGuard":"boolean hasRootScopeId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try {\n    query.caseInstanceRootScopeId(rootScopeId);\n} catch (FlowableIllegalArgumentException e) {\n    throw new BadRequestException(\"rootScopeId is required\", e);\n}","preventionTips":["Resolve the root scope id before querying","Use Optional<String> for hierarchy ids that may be absent","Validate hierarchy parameters at the API layer","Null-check parent entities before reading their scope ids"],"tags":["java","flowable","cmmn","null-argument","query-validation"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}