{"record":{"id":"4a63aa3e0988c597","repo":"flowable/flowable-engine","slug":"task-assignee-list-is-empty-4a63aa","errorCode":null,"errorMessage":"Task assignee list is empty","messagePattern":"Task assignee list is empty","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java","lineNumber":556,"sourceCode":"    }\n\n    @Override\n    public HistoricTaskInstanceQuery taskAssigneeLikeIgnoreCase(String taskAssigneeLikeIgnoreCase) {\n        if (inOrStatement) {\n            this.currentOrQueryObject.taskAssigneeLikeIgnoreCase = taskAssigneeLikeIgnoreCase.toLowerCase();\n        } else {\n            this.taskAssigneeLikeIgnoreCase = taskAssigneeLikeIgnoreCase.toLowerCase();\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricTaskInstanceQuery 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 (taskAssignee != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssignee\");\n        }\n        if (taskAssigneeLike != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLike\");\n        }\n        if (taskAssigneeLikeIgnoreCase != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLikeIgnoreCase\");\n        }\n\n        if (inOrStatement) {","sourceCodeStart":538,"sourceCodeEnd":574,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java#L538-L574","documentation":"HistoricTaskInstanceQueryImpl.taskAssigneeIds(List<String>) validates its input before storing it. Passing an empty (non-null) assigneeIds list makes the query filter meaningless, so the engine throws ActivitiIllegalArgumentException instead of returning an empty result set. This is eager fail-fast input validation on the query builder.","triggerScenarios":"Calling taskAssigneeIds(Collections.emptyList()) or taskAssigneeIds(new ArrayList<>()) on a HistoricTaskInstanceQuery (or via the or() block) with a list that has size 0.","commonSituations":"Building the list dynamically from user-selected assignees and calling the query even when nothing was selected; passing a config-driven list that defaults to empty; copying a pattern from taskAssignee(single value) without guarding the list size.","solutions":["Check !assigneeIds.isEmpty() before calling taskAssigneeIds and skip the assignee filter (or fall back to an unfiltered query) when empty.","If the empty list means 'no filter intended', omit the taskAssigneeIds(...) call entirely rather than passing an empty list.","If the empty list is a genuine error in your domain, fail earlier with a clearer application-level message naming the missing selection."],"exampleFix":"// before\nList<String> ids = selectedAssignees();\nquery.taskAssigneeIds(ids);\n\n// after\nList<String> ids = selectedAssignees();\nif (ids != null && !ids.isEmpty()) {\n    query.taskAssigneeIds(ids);\n}","handlingStrategy":"validation","validationCode":"// Java\nif (assigneeIds == null || assigneeIds.isEmpty()) {\n    // skip filter or handle explicitly before calling\n}","typeGuard":null,"tryCatchPattern":"try {\n    query.taskAssigneeIds(ids);\n} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {\n    // fall back to unfiltered query or report invalid input\n}","preventionTips":["Never call list-based query filters with a list you have not size-checked.","Centralize query building in a helper that applies filters only for present criteria.","Treat empty list and absent filter as distinct cases in your API layer."],"tags":["query-builder","input-validation","flowable","activiti"],"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"}