{"record":{"id":"654e930824fd3c26","repo":"flowable/flowable-engine","slug":"involvedgroups-are-empty-654e93","errorCode":null,"errorMessage":"involvedGroups are empty","messagePattern":"involvedGroups are empty","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/HistoricProcessInstanceQueryImpl.java","lineNumber":641,"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 HistoricProcessInstanceQuery involvedGroups(Set<String> involvedGroups) {\n        if (involvedGroups == null) {\n            throw new FlowableIllegalArgumentException(\"involvedGroups are null\");\n        }\n        if (involvedGroups.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"involvedGroups are empty\");\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 HistoricProcessInstanceQuery includeProcessVariables() {\n        this.includeProcessVariables = true;\n        return this;\n    }\n\n    @Override\n    public HistoricProcessInstanceQuery includeProcessVariables(Collection<String> variableNames) {\n        if (variableNames == null || variableNames.isEmpty()) {","sourceCodeStart":623,"sourceCodeEnd":659,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/HistoricProcessInstanceQueryImpl.java#L623-L659","documentation":"HistoricProcessInstanceQuery.involvedGroups(Set<String>) rejects empty sets. Flowable throws FlowableIllegalArgumentException when involvedGroups is non-null but empty, because an empty IN filter on group identity links is undefined. Validation is fail-fast at query-build time.","triggerScenarios":"Calling involvedGroups(groups) with a non-null but empty Set — e.g. new HashSet<>() passed directly, or the group list emptied after filtering/removals upstream.","commonSituations":"Users with no group memberships in authorization-filtered history queries; batch jobs that drained the group list before query construction; pagination logic yielding an empty id batch.","solutions":["Ensure at least one group id is present before calling involvedGroups","Guard with !groups.isEmpty() and skip the criterion or return an empty result early","Model 'no groups' explicitly: choose between an unfiltered query and a guaranteed-empty result","Use involvedGroup(String, String) if only a single group is relevant"],"exampleFix":"// before\nquery.involvedGroups(groups); // throws when groups.isEmpty()\n// after\nif (groups != null && !groups.isEmpty()) {\n    query.involvedGroups(groups);\n} else {\n    return Collections.emptyList();\n}","handlingStrategy":"validation","validationCode":"if (groups == null || groups.isEmpty()) {\n    return Collections.emptyList(); // nothing to query\n}\nquery.involvedGroups(groups);","typeGuard":"boolean hasGroups(Set<String> groups) {\n    return groups != null && !groups.isEmpty();\n}","tryCatchPattern":"try {\n    query.involvedGroups(groups);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"empty\")) {\n        return Collections.emptyList();\n    }\n    throw e;\n}","preventionTips":["Short-circuit to an empty result when the group set is empty","Check both null and isEmpty before IN-style criteria","Add tests for users without group memberships","Avoid draining/filtering group collections to empty before query construction"],"tags":["flowable","empty-collection","identity-link","query-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"}