{"record":{"id":"25f4cfcbba9bd3da","repo":"flowable/flowable-engine","slug":"task-assignee-list-is-empty-25f4cf","errorCode":null,"errorMessage":"Task assignee list is empty","messagePattern":"Task assignee list is empty","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java","lineNumber":472,"sourceCode":"    public TaskQuery taskAssigneeLikeIgnoreCase(String assigneeLikeIgnoreCase) {\n        if (assigneeLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"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(Collection<String> assigneeIds) {\n        if (assigneeIds == null) {\n            throw new FlowableIllegalArgumentException(\"Task assignee list is null\");\n        }\n        if (assigneeIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Task assignee list is empty\");\n        }\n        for (String assignee : assigneeIds) {\n            if (assignee == null) {\n                throw new FlowableIllegalArgumentException(\"None of the given task assignees can be null\");\n            }\n        }\n\n        if (assignee != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssignee\");\n        }\n        if (assigneeLike != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLike\");\n        }\n        if (assigneeLikeIgnoreCase != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLikeIgnoreCase\");\n        }\n\n        if (orActive) {","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L454-L490","documentation":"taskAssigneeIds(Collection<String>) rejects an empty collection with this message. Flowable treats an empty assignee list as a query-usage mistake rather than an innocuous no-op filter, since it almost always indicates uninitialized input and would silently match nothing. Callers must pass at least one assignee ID.","triggerScenarios":"Calling taskQuery.taskAssigneeIds(new ArrayList<>()) or taskAssigneeIds(Collections.emptyList()) — e.g. when a filter UI produced no selections or a group lookup returned no members.","commonSituations":"Building a query from user-selected filters where nothing was selected; a lookup of team members returning an empty set; passing a default-initialized empty list instead of omitting the filter.","solutions":["Only call taskAssigneeIds when the collection is non-empty; omit the filter otherwise.","If all tasks should match, construct the query without an assignee constraint.","Populate the list with the intended assignee IDs before querying."],"exampleFix":"// before\nList<String> ids = getSelectedAssignees();\ntaskQuery.taskAssigneeIds(ids);\n\n// after\nList<String> ids = getSelectedAssignees();\nif (ids != null && !ids.isEmpty()) {\n    taskQuery.taskAssigneeIds(ids);\n}","handlingStrategy":"validation","validationCode":"if (assigneeIds == null || assigneeIds.isEmpty()) { return null; /* skip filter */ }\ntaskQuery.taskAssigneeIds(assigneeIds);","typeGuard":"boolean usable = assigneeIds != null && !assigneeIds.isEmpty();","tryCatchPattern":"try {\n    taskQuery.taskAssigneeIds(assigneeIds);\n} catch (FlowableIllegalArgumentException e) {\n    if (!\"Task assignee list is empty\".equals(e.getMessage())) throw e;\n    // fall back to query without assignee filter\n}","preventionTips":["Treat empty filter selections as 'no filter' rather than passing them on.","Centralize a guard helper that applies collection filters only when non-empty.","Decide explicitly whether empty means 'match all' or 'error' in your domain and code it."],"tags":["flowable","task-query","empty-collection","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"}