{"record":{"id":"79dc06f04564260d","repo":"flowable/flowable-engine","slug":"referencescopeid-is-empty","errorCode":null,"errorMessage":"referenceScopeId is empty","messagePattern":"referenceScopeId 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":94,"sourceCode":"            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\");\n        }\n        this.scopeType = scopeType;\n        return this;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> referenceScopeId(String referenceScopeId) {\n        if (StringUtils.isEmpty(referenceScopeId)) {\n            throw new FlowableIllegalArgumentException(\"referenceScopeId is empty\");\n        }\n        this.referenceScopeId = referenceScopeId;\n        return this;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> referenceScopeDefinitionId(String referenceScopeDefinitionId) {\n        if (StringUtils.isEmpty(referenceScopeDefinitionId)) {\n            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\");","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-entitylink-service/src/main/java/org/flowable/entitylink/service/impl/InternalEntityLinkQueryImpl.java#L76-L112","documentation":"Fluent-setter validation in InternalEntityLinkQueryImpl.referenceScopeId: the referenced scope id filter is null or blank; entity-link queries need a concrete reference scope, so the empty value is refused.","triggerScenarios":"Calling InternalEntityLinkQuery.referenceScopeId(\"\") or referenceScopeId(null).","commonSituations":"The referenced entity (e.g. a child process/case instance) was not created, so its id is missing; passing a null return value from a previous service call directly into the query.","solutions":["Verify the referenced entity exists and capture its id before querying.","Null/blank-check the id before invoking the query builder.","Correct upstream code that should populate the reference scope id."],"exampleFix":"// before\nquery.referenceScopeId(childInstanceId).list();\n\n// after\nif (StringUtils.isNotBlank(childInstanceId)) {\n    query.referenceScopeId(childInstanceId).list();\n}","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(referenceScopeId)) { throw new IllegalArgumentException(\"referenceScopeId required\"); }","typeGuard":null,"tryCatchPattern":"try {\n    links = entityLinkQuery.referenceScopeId(refId).list();\n} catch (FlowableIllegalArgumentException e) {\n    links = Collections.emptyList();\n}","preventionTips":["Confirm the referenced entity exists and its id is captured before querying","Blank-check ids chained from prior service calls","Fail fast when reference creation did not produce an id"],"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"}