{"record":{"id":"ed0fc6712a0da3c5","repo":"flowable/flowable-engine","slug":"involved-groups-are-empty","errorCode":null,"errorMessage":"Involved groups are empty","messagePattern":"Involved groups are empty","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java","lineNumber":622,"sourceCode":"        }\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 {\n            this.suspensionState = SuspensionState.ACTIVE;\n        }\n        return this;","sourceCodeStart":604,"sourceCodeEnd":640,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java#L604-L640","documentation":"ProcessInstanceQueryImpl.involvedGroups(Set<String>) requires a non-null, non-empty set of group IDs. Flowable throws FlowableIllegalArgumentException when an empty set is passed because an 'involved groups' filter matches nothing by definition, and an empty filter would silently produce an unusable or misleading query. The library fails fast instead of building a query with no filtering semantics.","triggerScenarios":"Calling processInstanceQuery.involvedGroups(new HashSet<>()) or involvedGroups(Collections.emptySet()), or passing a set built from an empty filter/selection UI. Passing null throws a sibling message 'Involved groups are null'.","commonSituations":"Building admin UIs where the user selected no groups but the code still applies the filter; building the set dynamically from role/tenant lookups that returned nothing; migrating code from another engine API that tolerated empty collections.","solutions":["Only call involvedGroups when the set has at least one element; skip the filter otherwise","Pre-populate the set with the intended group IDs before building the query","Fix upstream group/role resolution so it returns the actual group IDs rather than an empty collection","Catch FlowableIllegalArgumentException and fall back to an unfiltered query if that is the desired behavior"],"exampleFix":"// before\nquery.involvedGroups(groupIds);\n// after\nif (groupIds != null && !groupIds.isEmpty()) {\n    query.involvedGroups(groupIds);\n} else {\n    query = runtimeService.createProcessInstanceQuery(); // drop the filter\n}","handlingStrategy":"validation","validationCode":"if (groupIds == null || groupIds.isEmpty()) {\n    throw new IllegalArgumentException(\"involvedGroups must contain at least one group id\");\n}","typeGuard":"boolean hasGroups = groupIds != null && !groupIds.isEmpty();","tryCatchPattern":"try {\n    query.involvedGroups(groupIds);\n} catch (FlowableIllegalArgumentException e) {\n    query = runtimeService.createProcessInstanceQuery(); // proceed unfiltered or rethrow\n}","preventionTips":["Check isEmpty() before applying any Set-based Flowable query filter","Skip filters entirely when no criteria were selected in the UI","Unit-test query builders with empty collections"],"tags":["flowable","process-instance-query","empty-collection","argument-validation"],"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"}