{"record":{"id":"ed714a5ea99d37a8","repo":"flowable/flowable-engine","slug":"task-assignee-list-is-empty-ed714a","errorCode":null,"errorMessage":"Task assignee list is empty","messagePattern":"Task assignee list is empty","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java","lineNumber":381,"sourceCode":"    public TaskQuery taskAssigneeLikeIgnoreCase(String assigneeLikeIgnoreCase) {\n        if (assigneeLikeIgnoreCase == null) {\n            throw new ActivitiIllegalArgumentException(\"assigneeLikeIgnoreCase is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();\n        } else {\n            this.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery taskAssigneeIds(List<String> assigneeIds) {\n        if (assigneeIds == null) {\n            throw new ActivitiIllegalArgumentException(\"Task assignee list is null\");\n        }\n        if (assigneeIds.isEmpty()) {\n            throw new ActivitiIllegalArgumentException(\"Task assignee list is empty\");\n        }\n        for (String assignee : assigneeIds) {\n            if (assignee == null) {\n                throw new ActivitiIllegalArgumentException(\"None of the given task assignees can be null\");\n            }\n        }\n\n        if (assignee != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssignee\");\n        }\n        if (assigneeLike != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLike\");\n        }\n        if (assigneeLikeIgnoreCase != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLikeIgnoreCase\");\n        }\n\n        if (orActive) {","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java#L363-L399","documentation":"Thrown by TaskQueryImpl.taskAssigneeIds(List<String>) when the assigneeIds list is non-null but empty. An empty IN () clause is invalid SQL and meaningless as a filter, so the library rejects it explicitly rather than producing a broken query or silently returning all tasks.","triggerScenarios":"Calling taskQuery.taskAssigneeIds(new ArrayList<>()) or passing a collection that ended up empty after filtering (e.g. no users selected, empty group).","commonSituations":"UI bulk-selection with nothing selected; filtering a role's members leaves zero ids; a stream filter reduced the candidate list to empty before query construction.","solutions":["Check isEmpty() before calling and skip the filter (or return an empty result directly) when the list is empty.","Populate the list with at least one valid assignee id.","If an empty selection must return nothing, short-circuit: return an empty task list without executing the query.","Validate the ids collection in the service layer before building the query."],"exampleFix":"// before\nquery.taskAssigneeIds(selectedIds); // selectedIds may be empty\n\n// after\nif (selectedIds == null || selectedIds.isEmpty()) {\n    return Collections.emptyList(); // or omit the filter\n}\nquery.taskAssigneeIds(selectedIds);","handlingStrategy":"validation","validationCode":"if (assigneeIds == null || assigneeIds.isEmpty()) {\n    return Collections.emptyList(); // nothing selected: no results (or omit filter)\n}\nquery.taskAssigneeIds(assigneeIds);","typeGuard":"boolean isQueryableIdList(List<String> l) { return l != null && !l.isEmpty(); }","tryCatchPattern":"try {\n    query.taskAssigneeIds(assigneeIds);\n} catch (ActivitiIllegalArgumentException e) {\n    throw new BadRequestException(\"Assignee ids must be non-empty\");\n}","preventionTips":["Decide semantics for empty selections: empty result vs no filter — then enforce before the call.","Check isEmpty() after any stream/filter transformation of the id list.","Validate collection inputs in the service layer."],"tags":["java","flowable","task-query","empty-collection","assignee"],"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"}