{"record":{"id":"10c492eb608042eb","repo":"flowable/flowable-engine","slug":"linktype-is-empty","errorCode":null,"errorMessage":"linkType is empty","messagePattern":"linkType 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":139,"sourceCode":"            throw new FlowableIllegalArgumentException(\"rootScopeId is empty\");\n        }\n        this.rootScopeId = rootScopeId;\n        return this;\n    }\n\n    @Override\n    public InternalEntityLinkQuery<E> rootScopeType(String rootScopeType) {\n        if (StringUtils.isEmpty(rootScopeType)) {\n            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    }","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-entitylink-service/src/main/java/org/flowable/entitylink/service/impl/InternalEntityLinkQueryImpl.java#L121-L157","documentation":"InternalEntityLinkQueryImpl.linkType sets the entity link type filter (e.g. 'participant', 'child'). It throws FlowableIllegalArgumentException when passed null or an empty string, because an empty linkType yields an invalid query. This is a fail-fast argument check on the query builder.","triggerScenarios":"Calling internalEntityLinkQuery.linkType(null) or linkType(\"\") while building the query.","commonSituations":"Storing the link type in a constant/enum whose value is empty, binding the link type from a request payload missing the field, or upgrading Flowable where the expected link type naming changed.","solutions":["Pass a valid link type constant, e.g. EntityLinkTypes.PARTICIPANT or CHILD.","Validate the link type source (request data, config) before calling the builder.","If no link type filter is needed, omit the call instead of passing an empty value."],"exampleFix":"// before\nquery.linkType(linkType); // linkType may be null\n// after\nif (StringUtils.isNotEmpty(linkType)) {\n    query.linkType(EntityLinkTypes.PARTICIPANT);\n}","handlingStrategy":"validation","validationCode":"if (linkType == null || linkType.isEmpty()) {\n    throw new IllegalArgumentException(\"linkType must be set (e.g. participant, child)\");\n}\ninternalEntityLinkQuery.linkType(linkType);","typeGuard":"boolean hasLinkType(String t) { return t != null && !t.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.linkType(linkType);\n} catch (FlowableIllegalArgumentException e) {\n    LOG.warn(\"linkType missing: {}\", e.getMessage());\n    throw new InvalidRequestException(\"linkType is required\", e);\n}","preventionTips":["Reference EntityLinkTypes constants, not ad-hoc strings.","Validate incoming request DTOs for linkType before querying.","Skip optional filters instead of passing empty strings."],"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"}