flowable/flowable-engine · error · FlowableIllegalArgumentException

groupId is null

Error message

groupId is null

What it means

HistoricCaseInstanceQueryImpl.involvedGroup(String groupId, String identityLinkType) throws FlowableIllegalArgumentException("groupId is null") when the groupId parameter is null. Group-based involvement filters require an actual group id combined with a link type to build the identity-link predicate.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java:1111

    public HistoricCaseInstanceQuery involvedUser(String userId, String identityLinkType) {
        if (userId == null) {
            throw new FlowableIllegalArgumentException("userId is null");
        }
        if (identityLinkType == null) {
            throw new FlowableIllegalArgumentException("identityLinkType is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.involvedUserIdentityLink = new IdentityLinkQueryObject(userId, null, identityLinkType);
        } else {
            this.involvedUserIdentityLink = new IdentityLinkQueryObject(userId, null, identityLinkType);
        }
        return this;
    }
    
    @Override
    public HistoricCaseInstanceQuery involvedGroup(String groupId, String identityLinkType) {
        if (groupId == null) {
            throw new FlowableIllegalArgumentException("groupId is null");
        }
        if (identityLinkType == null) {
            throw new FlowableIllegalArgumentException("identityLinkType is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.involvedGroupIdentityLink = new IdentityLinkQueryObject(null, groupId, identityLinkType);
        } else {
            this.involvedGroupIdentityLink = new IdentityLinkQueryObject(null, groupId, identityLinkType);
        }
        return this;
    }

    @Override
    public HistoricCaseInstanceQuery involvedGroups(Set<String> groupIds) {
        if (groupIds == null) {
            throw new FlowableIllegalArgumentException("groupIds are null");
        }
        if (groupIds.isEmpty()) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Check groupId for null before calling involvedGroup.
  2. Handle the no-group case explicitly (skip the filter or use a user-based filter instead).
  3. Remember the same method also throws "identityLinkType is null" — validate both parameters.
  4. Ensure group-resolution helpers never return null; return an empty collection and branch on it.

Example fix

// before
query.involvedGroup(groupId, IdentityLinkType.PARTICIPANT); // groupId may be null
// after
if (groupId != null) {
    query.involvedGroup(groupId, IdentityLinkType.PARTICIPANT);
}
Defensive patterns

Strategy: validation

Validate before calling

if (groupId == null || groupId.isEmpty()) {
    throw new IllegalArgumentException("groupId is required");
}
if (identityLinkType == null) {
    throw new IllegalArgumentException("identityLinkType is required");
}
query.involvedGroup(groupId, identityLinkType);

Type guard

boolean canFilterByGroupLink(String groupId, String type) {
    return groupId != null && type != null;
}

Try / catch

try {
    query.involvedGroup(groupId, identityLinkType);
} catch (FlowableIllegalArgumentException e) {
    if (e.getMessage() != null && e.getMessage().contains("is null")) {
        // skip group filter or rethrow with context
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Calling involvedGroup(null, identityLinkType) on a HistoricCaseInstanceQuery before executing the query.

Common situations: Group id resolved from user memberships was empty (user in no group) and surfaced as null; tenant/group config missing; refactoring where the group id variable was dropped.

Related errors


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