{"record":{"id":"953386d9b5a060c1","repo":"flowable/flowable-engine","slug":"rootscopeid-is-null-953386","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/runtime/CaseInstanceQueryImpl.java","lineNumber":373,"sourceCode":"    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceNameLikeIgnoreCase(String nameLikeIgnoreCase) {\n        if (nameLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"Name like ignore case is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.nameLikeIgnoreCase = nameLikeIgnoreCase;\n        } else {\n            this.nameLikeIgnoreCase = nameLikeIgnoreCase;\n        }\n        return this;\n    }\n\n    @Override\n    public CaseInstanceQuery 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 CaseInstanceQuery 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":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java#L355-L391","documentation":"Flowable throws FlowableIllegalArgumentException from CaseInstanceQueryImpl.caseInstanceRootScopeId(String) when the root scope id is null. The root scope id identifies the top-level scope (case or process) and null is never a valid filter, so it is rejected during query construction. Skip the method call when the id is unknown.","triggerScenarios":"Calling createCaseInstanceQuery().caseInstanceRootScopeId(null), usually because the root scope id came from a lookup on an entity that has no root scope, or from an unset/missing parameter.","commonSituations":"Navigation from child entities (plan items, tasks) whose rootScopeId was not populated; API endpoints with optional root-scope filters; data from older Flowable versions before rootScopeId existed.","solutions":["Guard the call: if (rootScopeId != null) query.caseInstanceRootScopeId(rootScopeId)","Verify the source of the root scope id — if it should exist but is null, fix the upstream lookup or data","Use caseInstanceId or caseInstanceParentId as alternative criteria when root scope is unavailable","Catch FlowableIllegalArgumentException around query building for graceful API error handling"],"exampleFix":"// before\nquery.caseInstanceRootScopeId(entity.getRootScopeId()); // may be null\n// after\nif (entity.getRootScopeId() != null) {\n    query.caseInstanceRootScopeId(entity.getRootScopeId());\n}","handlingStrategy":"validation","validationCode":"if (rootScopeId != null) { query.caseInstanceRootScopeId(rootScopeId); }","typeGuard":"boolean hasRootScope = rsId instanceof String s && !s.isBlank();","tryCatchPattern":"try { query.caseInstanceRootScopeId(rootScopeId); } catch (FlowableIllegalArgumentException e) { log.warn(\"Null rootScopeId supplied to case instance query\"); throw new BadRequestException(e.getMessage()); }","preventionTips":["Null-check rootScopeId obtained from child entities before filtering","Confirm entity data predates/contains rootScopeId when migrating Flowable versions","Prefer explicit alternative criteria (caseInstanceId) when root scope is unknown"],"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"}