{"record":{"id":"8935ecadbbf78973","repo":"flowable/flowable-engine","slug":"involved-groups-are-null","errorCode":null,"errorMessage":"Involved groups are null","messagePattern":"Involved groups are null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java","lineNumber":619,"sourceCode":"    public ProcessInstanceQuery involvedGroup(String groupId, String identityLinkType) {\n        if (groupId == null) {\n            throw new FlowableIllegalArgumentException(\"groupId is null\");\n        }\n        if (identityLinkType == null) {\n            throw new FlowableIllegalArgumentException(\"identityLinkType is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.involvedGroupIdentityLink = new IdentityLinkQueryObject(null, groupId, identityLinkType);\n        } else {\n            this.involvedGroupIdentityLink = new IdentityLinkQueryObject(null, groupId, identityLinkType);\n        }\n        return this;\n    }\n\n    @Override\n    public ProcessInstanceQuery involvedGroups(Set<String> involvedGroups) {\n        if (involvedGroups == null) {\n            throw new FlowableIllegalArgumentException(\"Involved groups are null\");\n        }\n        if (involvedGroups.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Involved groups are empty\");\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.involvedGroups = involvedGroups;\n        } else {\n            this.involvedGroups = involvedGroups;\n        }\n        return this;\n    }\n\n    @Override\n    public ProcessInstanceQuery active() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.suspensionState = SuspensionState.ACTIVE;\n        } else {","sourceCodeStart":601,"sourceCodeEnd":637,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java#L601-L637","documentation":"ProcessInstanceQuery.involvedGroups(Set<String>) requires a non-null set of group ids; Flowable throws FlowableIllegalArgumentException(\"Involved groups are null\") when the set is null (and a companion error when it is empty). It validates the bulk involved-groups criterion before executing.","triggerScenarios":"Calling involvedGroups(null), or passing a set-producing method whose result is null (e.g. map.get(\"groups\"), a cache miss, or an optional that was unwrapped unsafely).","commonSituations":"Building filters from user-supplied request parameters where the groups parameter was absent; deserialization of a filter JSON that lacked the groups key; migrating from involvedGroup loops to the batch involvedGroups API and passing an unpopulated variable.","solutions":["Ensure a non-null Set is passed, e.g. involvedGroups(Collections.emptySet()) when there are no groups (but note empty also throws — skip the call instead)","Default to an empty set and conditionally apply the criterion only when groups are present and non-empty","Fix the upstream producer so the group set is initialized before query construction"],"exampleFix":"// before\nquery.involvedGroups(filter.getGroups()); // may be null\n// after\nSet<String> groups = filter.getGroups();\nif (groups != null && !groups.isEmpty()) {\n    query.involvedGroups(groups);\n}","handlingStrategy":"validation","validationCode":"if (involvedGroups == null || involvedGroups.isEmpty()) {\n    // skip criterion entirely; involvedGroups rejects null AND empty\n    return baseQuery;\n}","typeGuard":"boolean hasGroups = involvedGroups != null && !involvedGroups.isEmpty();","tryCatchPattern":"try {\n    query.involvedGroups(groups);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"Involved groups are\")) {\n        log.warn(\"Skipping involvedGroups filter: null or empty set\");\n    } else {\n        throw e;\n    }\n}","preventionTips":["Initialize group sets to an empty Set at declaration, never null","Check both null and isEmpty before applying the criterion","Validate request/filter DTOs so missing 'groups' fields become empty sets"],"tags":["flowable","null-check","query-api","java"],"backgroundTag":"null-argument","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"}