flowable/flowable-engine · error · FlowableIllegalArgumentException

rootScopeType is empty

Error message

rootScopeType is empty

What it means

InternalEntityLinkQueryImpl.rootScopeType sets the root scope type filter (e.g. 'proc', 'cmmn', 'task'). It throws FlowableIllegalArgumentException when passed null or an empty string, since a root-scope-type filter must have a concrete value to be meaningful. This is fail-fast validation on the query builder.

Solutions

  1. Pass a valid scope type constant (e.g. ScopeTypes.PROCESS, 'cmmn', 'task') instead of the empty value.
  2. Check where the scope type value originates and fix the source so it is populated.
  3. Skip the rootScopeType filter entirely if the value is not available rather than passing an empty string.

Example fix

// before
query.rootScopeType(scopeType); // scopeType may be ""
// after
if (StringUtils.isNotEmpty(scopeType)) {
    query.rootScopeType(scopeType);
}
Defensive patterns

Strategy: validation

Validate before calling

if (rootScopeType == null || rootScopeType.isEmpty()) {
    throw new IllegalArgumentException("rootScopeType must be a valid scope type");
}
internalEntityLinkQuery.rootScopeType(rootScopeType);

Type guard

boolean isValidScopeType(String t) { return "proc".equals(t) || "cmmn".equals(t) || "task".equals(t); }

Try / catch

try {
    query.rootScopeType(scopeType);
} catch (FlowableIllegalArgumentException e) {
    LOG.warn("Empty rootScopeType, skipping filter: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Calling internalEntityLinkQuery.rootScopeType(null) or rootScopeType("") when constructing the query.

Common situations: Deriving scope type dynamically from configuration or a variable that is unset, passing the wrong variable to the builder, or a typo where an uninitialized field is fed to the query.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/5c211dcee3adb35a. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-entitylink-service/src/main/java/org/flowable/entitylink/service/impl/InternalEntityLinkQueryImpl.java:130

            throw new FlowableIllegalArgumentException("referenceScopeType is empty");
        }
        this.referenceScopeType = referenceScopeType;
        return this;
    }

    @Override
    public InternalEntityLinkQuery<E> rootScopeId(String rootScopeId) {
        if (StringUtils.isEmpty(rootScopeId)) {
            throw new FlowableIllegalArgumentException("rootScopeId is empty");
        }
        this.rootScopeId = rootScopeId;
        return this;
    }

    @Override
    public InternalEntityLinkQuery<E> rootScopeType(String rootScopeType) {
        if (StringUtils.isEmpty(rootScopeType)) {
            throw new FlowableIllegalArgumentException("rootScopeType is empty");
        }
        this.rootScopeType = rootScopeType;
        return this;
    }

    @Override
    public InternalEntityLinkQuery<E> linkType(String linkType) {
        if (StringUtils.isEmpty(linkType)) {
            throw new FlowableIllegalArgumentException("linkType is empty");
        }
        this.linkType = linkType;
        return this;
    }

    @Override
    public InternalEntityLinkQuery<E> hierarchyType(String hierarchyType) {
        if (StringUtils.isEmpty(hierarchyType)) {
            throw new FlowableIllegalArgumentException("hierarchyType is empty");

View on GitHub (pinned to d6d39ce1c6)