{"record":{"id":"e606d84da8325a3d","repo":"flowable/flowable-engine","slug":"scopeid-is-empty","errorCode":null,"errorMessage":"scopeId is empty","messagePattern":"scopeId 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":58,"sourceCode":"    protected String scopeType;\n    protected String referenceScopeId;\n    protected String referenceScopeDefinitionId;\n    protected String referenceScopeType;\n    protected String rootScopeId;\n    protected String rootScopeType;\n    protected String linkType;\n    protected String hierarchyType;\n\n    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\");","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-entitylink-service/src/main/java/org/flowable/entitylink/service/impl/InternalEntityLinkQueryImpl.java#L40-L76","documentation":"Fluent-setter validation in InternalEntityLinkQueryImpl.scopeId: the scope id filter is null or empty (StringUtils.isEmpty), which would break entity-link SQL scoping; the builder rejects it so the caller fixes the identifier.","triggerScenarios":"Calling InternalEntityLinkQuery.scopeId(\"\") or scopeId(null) before executing the query.","commonSituations":"A process/case variable holding the scope id was not set yet; passing an uninitialized String field from caller code; copying a query builder chain from code where the id lookup failed silently.","solutions":["Check the value with StringUtils.isNotBlank before calling scopeId.","Ensure the entity whose id you pass actually exists and its id was fetched correctly.","Guard the query-building code so the query is only executed when a scope id is available."],"exampleFix":"// before\nquery.scopeId(scopeId).list(); // may throw if empty\n\n// after\nif (StringUtils.isNotBlank(scopeId)) {\n    query.scopeId(scopeId).list();\n}","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(scopeId)) { throw new IllegalArgumentException(\"scopeId required\"); }","typeGuard":null,"tryCatchPattern":"try {\n    links = entityLinkQuery.scopeId(scopeId).list();\n} catch (FlowableIllegalArgumentException e) {\n    links = Collections.emptyList();\n}","preventionTips":["Blank-check all ids before building entity-link queries","Centralize query construction in a helper that validates inputs","Ensure upstream id lookups fail fast instead of returning empty strings"],"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"}