{"record":{"id":"330897baed1fb4a8","repo":"flowable/flowable-engine","slug":"scopeids-is-empty","errorCode":null,"errorMessage":"scopeIds is empty","messagePattern":"scopeIds 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":67,"sourceCode":"    public InternalEntityLinkQueryImpl(Function<InternalEntityLinkQueryImpl<E>, List<E>> listProvider,\n            Function<InternalEntityLinkQueryImpl<E>, E> singleResultProvider) {\n        this.listProvider = listProvider;\n        this.singleResultProvider = singleResultProvider;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> scopeId(String scopeId) {\n        if (StringUtils.isEmpty(scopeId)) {\n            throw new FlowableIllegalArgumentException(\"scopeId is empty\");\n        }\n        this.scopeId = scopeId;\n        return this;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> scopeIds(Collection<String> scopeIds) {\n        if (scopeIds == null || scopeIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"scopeIds is empty\");\n        }\n        this.scopeIds = scopeIds;\n        return this;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> scopeDefinitionId(String scopeDefinitionId) {\n        if (StringUtils.isEmpty(scopeDefinitionId)) {\n            throw new FlowableIllegalArgumentException(\"scopeDefinitionId is empty\");\n        }\n        this.scopeDefinitionId = scopeDefinitionId;\n        return this;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> scopeType(String scopeType) {\n        if (StringUtils.isEmpty(scopeType)) {\n            throw new FlowableIllegalArgumentException(\"scopeType is empty\");","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-entitylink-service/src/main/java/org/flowable/entitylink/service/impl/InternalEntityLinkQueryImpl.java#L49-L85","documentation":"Fluent-setter validation in InternalEntityLinkQueryImpl.scopeIds: the scope-id collection filter is null or empty, so an IN clause cannot be built and the query builder rejects it rather than returning unscoped results.","triggerScenarios":"Calling InternalEntityLinkQuery.scopeIds(null), scopeIds(Collections.emptyList()), or scopeIds(list) where the list was never populated.","commonSituations":"Building queries from a dynamic set of ids that turned out empty (e.g. no matching parent scopes found); passing an uninitialized collection variable.","solutions":["Check !CollectionUtils.isEmpty(scopeIds) before calling.","Skip the query entirely or use an unfiltered variant when no ids are available.","Verify the upstream logic that populates the collection."],"exampleFix":"// before\nquery.scopeIds(ids).list(); // throws when ids empty\n\n// after\nif (ids != null && !ids.isEmpty()) {\n    query.scopeIds(ids).list();\n}","handlingStrategy":"validation","validationCode":"if (CollectionUtils.isEmpty(scopeIds)) { return Collections.emptyList(); }","typeGuard":null,"tryCatchPattern":"try {\n    links = entityLinkQuery.scopeIds(ids).list();\n} catch (FlowableIllegalArgumentException e) {\n    links = Collections.emptyList();\n}","preventionTips":["Skip the query when the id collection is empty","Guard collection-populating logic against producing empty lists silently","Use CollectionUtils.isEmpty checks in query builders"],"tags":["entitylink","query","validation"],"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"}