{"record":{"id":"5516e0c219e16c66","repo":"flowable/flowable-engine","slug":"hierarchytype-is-empty","errorCode":null,"errorMessage":"hierarchyType is empty","messagePattern":"hierarchyType 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":148,"sourceCode":"            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\");\n        }\n        this.linkType = linkType;\n        return this;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> hierarchyType(String hierarchyType) {\n        if (StringUtils.isEmpty(hierarchyType)) {\n            throw new FlowableIllegalArgumentException(\"hierarchyType is empty\");\n        }\n        this.hierarchyType = hierarchyType;\n        return this;\n    }\n\n    @Override\n    public List<E> list() {\n        return listProvider.apply(this);\n    }\n\n    @Override\n    public E singleResult() {\n        return singleResultProvider.apply(this);\n    }\n\n    public Collection<String> getScopeIds() {\n        return scopeIds;\n    }","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-entitylink-service/src/main/java/org/flowable/entitylink/service/impl/InternalEntityLinkQueryImpl.java#L130-L166","documentation":"InternalEntityLinkQueryImpl.hierarchyType sets the hierarchy type filter for entity link queries (e.g. hierarchy-level filtering). It throws FlowableIllegalArgumentException when passed null or an empty string, as an empty hierarchyType cannot define a valid filter. Fail-fast argument validation on the query builder.","triggerScenarios":"Calling internalEntityLinkQuery.hierarchyType(null) or hierarchyType(\"\") while building the query.","commonSituations":"Passing an uninitialized configuration value, mapping a missing request/DTO field into the query, or confusing hierarchyType with scopeType and passing an empty default.","solutions":["Supply the correct hierarchy type value (e.g. 'root', 'all' depending on the API contract) before querying.","Trace the value's origin and fix the code/config that leaves it empty.","Omit the hierarchyType filter if not required rather than passing an empty string."],"exampleFix":"// before\nquery.hierarchyType(hierarchyType); // may be empty\n// after\nif (StringUtils.isNotEmpty(hierarchyType)) {\n    query.hierarchyType(hierarchyType);\n}","handlingStrategy":"validation","validationCode":"if (hierarchyType == null || hierarchyType.isEmpty()) {\n    throw new IllegalArgumentException(\"hierarchyType must be set before querying\");\n}\ninternalEntityLinkQuery.hierarchyType(hierarchyType);","typeGuard":"boolean hasHierarchyType(String t) { return t != null && !t.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.hierarchyType(hierarchyType);\n} catch (FlowableIllegalArgumentException e) {\n    LOG.warn(\"hierarchyType not set: {}\", e.getMessage());\n}","preventionTips":["Define hierarchy type values as constants or an enum.","Validate configuration at startup so empty values never reach the query.","Distinguish hierarchyType vs scopeType clearly in your code."],"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"}