{"record":{"id":"8126def5e662f27d","repo":"flowable/flowable-engine","slug":"rootscopeid-is-empty","errorCode":null,"errorMessage":"rootScopeId is empty","messagePattern":"rootScopeId is empty","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-entitylink-service/src/main/java/org/flowable/entitylink/service/impl/InternalEntityLinkQueryImpl.java","lineNumber":121,"sourceCode":"            throw new FlowableIllegalArgumentException(\"referenceScopeDefinitionId is empty\");\n        }\n        this.referenceScopeDefinitionId = referenceScopeDefinitionId;\n        return this;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> referenceScopeType(String referenceScopeType) {\n        if (StringUtils.isEmpty(referenceScopeType)) {\n            throw new FlowableIllegalArgumentException(\"referenceScopeType is empty\");\n        }\n        this.referenceScopeType = referenceScopeType;\n        return this;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> rootScopeId(String rootScopeId) {\n        if (StringUtils.isEmpty(rootScopeId)) {\n            throw new FlowableIllegalArgumentException(\"rootScopeId is empty\");\n        }\n        this.rootScopeId = rootScopeId;\n        return this;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> rootScopeType(String rootScopeType) {\n        if (StringUtils.isEmpty(rootScopeType)) {\n            throw new FlowableIllegalArgumentException(\"rootScopeType is empty\");\n        }\n        this.rootScopeType = rootScopeType;\n        return this;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> linkType(String linkType) {\n        if (StringUtils.isEmpty(linkType)) {\n            throw new FlowableIllegalArgumentException(\"linkType is empty\");","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-entitylink-service/src/main/java/org/flowable/entitylink/service/impl/InternalEntityLinkQueryImpl.java#L103-L139","documentation":"InternalEntityLinkQueryImpl.rootScopeId sets the root scope filter for entity link queries. The library throws FlowableIllegalArgumentException when the caller passes null or an empty string, because an empty rootScopeId would produce a meaningless query filter. This is a fail-fast argument validation guard on a query builder method.","triggerScenarios":"Calling internalEntityLinkQuery.rootScopeId(null) or rootScopeId(\"\") while building an InternalEntityLinkQuery.","commonSituations":"Populating the query from a runtime variable, request parameter, or entity field that is null/not yet set (e.g. an entity without an assigned root scope), or refactoring code where the scope id lookup returned empty.","solutions":["Ensure a non-empty rootScopeId is resolved before building the query (check the source entity's root scope id).","Guard the caller: only call rootScopeId when the value is non-null and non-empty, or use a different query path that doesn't filter by root scope.","Verify the upstream entity data actually has a root scope id populated; fix the data or creation code if it is missing."],"exampleFix":"// before\nquery.rootScopeId(processInstance.getRootScopeId());\n// after\nif (StringUtils.isNotEmpty(processInstance.getRootScopeId())) {\n    query.rootScopeId(processInstance.getRootScopeId());\n}","handlingStrategy":"validation","validationCode":"if (rootScopeId == null || rootScopeId.isEmpty()) {\n    throw new IllegalArgumentException(\"rootScopeId must be provided before querying\");\n}\ninternalEntityLinkQuery.rootScopeId(rootScopeId);","typeGuard":"boolean hasRootScopeId(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.rootScopeId(rootScopeId);\n} catch (FlowableIllegalArgumentException e) {\n    LOG.warn(\"Rejected empty rootScopeId: {}\", e.getMessage());\n}","preventionTips":["Always resolve the scope id from the entity before building the query.","Add a null/empty assertion on scope ids at API boundaries.","Centralize query construction in one helper that validates filters."],"tags":["validation","empty-argument","query-builder"],"backgroundTag":"empty-required-field","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"}