{"record":{"id":"a6a6f4132020a4ae","repo":"flowable/flowable-engine","slug":"referencescopedefinitionid-is-empty","errorCode":null,"errorMessage":"referenceScopeDefinitionId is empty","messagePattern":"referenceScopeDefinitionId 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":103,"sourceCode":"            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\");\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\");","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-entitylink-service/src/main/java/org/flowable/entitylink/service/impl/InternalEntityLinkQueryImpl.java#L85-L121","documentation":"Fluent-setter validation in InternalEntityLinkQueryImpl.referenceScopeDefinitionId: the reference scope definition id filter is null or empty and is rejected before query execution.","triggerScenarios":"Calling InternalEntityLinkQuery.referenceScopeDefinitionId(\"\") or referenceScopeDefinitionId(null).","commonSituations":"Definition id of the referenced process/case not resolved (missing deployment or wrong definition key); copying a query builder template and leaving the field blank.","solutions":["Fetch the referenced definition id via RepositoryService before building the query.","Blank-check the value before setting it.","Only apply the filter when a definition id is actually known."],"exampleFix":"// before\nquery.referenceScopeDefinitionId(\"\").list();\n\n// after\nif (StringUtils.isNotBlank(refDefId)) {\n    query.referenceScopeDefinitionId(refDefId).list();\n}","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(referenceScopeDefinitionId)) { throw new IllegalArgumentException(\"referenceScopeDefinitionId required\"); }","typeGuard":null,"tryCatchPattern":"try {\n    links = entityLinkQuery.referenceScopeDefinitionId(refDefId).list();\n} catch (FlowableIllegalArgumentException e) {\n    links = Collections.emptyList();\n}","preventionTips":["Fetch the referenced definition id from the repository before building the query","Only apply optional filters when values are known non-blank","Share validation logic across query-builder call sites"],"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"}