{"record":{"id":"077111a74c442cf8","repo":"flowable/flowable-engine","slug":"involved-groups-are-empty-077111","errorCode":null,"errorMessage":"Involved groups are empty","messagePattern":"Involved groups are empty","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/HistoricTaskInstanceQueryImpl.java","lineNumber":1961,"sourceCode":"        if (involvedUser == null) {\n            throw new FlowableIllegalArgumentException(\"involved user is null\");\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.involvedUser = involvedUser;\n        } else {\n            this.involvedUser = involvedUser;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricTaskInstanceQuery taskInvolvedGroups(Collection<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        if (inOrStatement) {\n            this.currentOrQueryObject.involvedGroups = involvedGroups;\n        } else {\n            this.involvedGroups = involvedGroups;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricTaskInstanceQuery ignoreAssigneeValue() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.ignoreAssigneeValue = true;\n        } else {\n            this.ignoreAssigneeValue = true;\n        }\n        return this;\n    }","sourceCodeStart":1943,"sourceCodeEnd":1979,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/HistoricTaskInstanceQueryImpl.java#L1943-L1979","documentation":"taskInvolvedGroups(Collection<String>) throws this error when the collection is non-null but empty. An empty collection cannot be turned into a meaningful IN-clause over identity links, so Flowable rejects it at query-build time.","triggerScenarios":"Calling taskInvolvedGroups(Collections.emptyList()) or a list reduced to zero elements by filtering (e.g. user is in no groups, or all groups were filtered out).","commonSituations":"Users with no group memberships; group lists filtered by tenant/type that end up empty; splitting an empty or blank string into a list.","solutions":["Guard with !involvedGroups.isEmpty() and omit the filter when the list is empty.","Decide the semantics of 'no groups': return an empty result immediately, or drop the group criterion entirely.","Before splitting a comma-separated string, trim and check for blank input."],"exampleFix":"// before\nquery.taskInvolvedGroups(groups); // throws when groups is empty\n\n// after\nif (groups != null && !groups.isEmpty()) {\n    query.taskInvolvedGroups(groups);\n}","handlingStrategy":"validation","validationCode":"if (involvedGroups != null && !involvedGroups.isEmpty()) {\n    historicTaskInstanceQuery.taskInvolvedGroups(involvedGroups);\n} else {\n    // no groups: either return empty result or omit this criterion\n}","typeGuard":"boolean hasGroups(Collection<String> groups) {\n    return groups != null && !groups.isEmpty();\n}","tryCatchPattern":"try {\n    query.taskInvolvedGroups(groups);\n} catch (FlowableIllegalArgumentException e) {\n    // empty list: short-circuit or drop the filter\n    return Collections.emptyList();\n}","preventionTips":["Treat empty group lists as 'no filter' explicitly and document that choice.","Check membership results before building the query.","Guard string splitting of group parameters for blank/empty input."],"tags":["flowable","query-validation","empty-collection","task-query"],"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"}