{"record":{"id":"d9be89ea0ea9bd85","repo":"flowable/flowable-engine","slug":"invalid-query-usage-cannot-set-both-taskassigneei-d9be89","errorCode":null,"errorMessage":"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLike","messagePattern":"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLike","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java","lineNumber":484,"sourceCode":"    @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) {\n            currentOrQueryObject.assigneeIds = assigneeIds;\n        } else {\n            this.assigneeIds = assigneeIds;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQueryImpl taskOwner(String owner) {\n        if (owner == null) {\n            throw new FlowableIllegalArgumentException(\"Owner is null\");\n        }","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L466-L502","documentation":"taskAssigneeIds cannot be combined with taskAssigneeLike(String) on the same query. Assignee-ID matching and assignee LIKE (pattern) matching are alternative filter styles, and Flowable forbids mixing them to keep the generated SQL unambiguous.","triggerScenarios":"Calling taskQuery.taskAssigneeLike(\"team-%\").taskAssigneeIds(ids) on the same TaskQuery instance, in either order.","commonSituations":"Combining pattern-based filters from one feature with ID-based filters from another; a generic query builder that applies all non-null criteria regardless of overlap.","solutions":["Drop the taskAssigneeLike(...) call when an explicit assignee-ID list is supplied.","Restructure filter assembly so only one assignee filter style is applied per query.","If pattern matching is required, convert the ID list into LIKE patterns instead of passing both."],"exampleFix":"// before\ntaskQuery.taskAssigneeLike(\"team-%\");\ntaskQuery.taskAssigneeIds(ids);\n\n// after\nif (ids != null && !ids.isEmpty()) {\n    taskQuery.taskAssigneeIds(ids);\n} else {\n    taskQuery.taskAssigneeLike(\"team-%\");\n}","handlingStrategy":"validation","validationCode":"if (assigneeIds != null && !assigneeIds.isEmpty() && assigneeLike != null) { throw new IllegalStateException(\"choose assigneeIds or assigneeLike, not both\"); }","typeGuard":"boolean conflict = assigneeLike != null && assigneeIds != null && !assigneeIds.isEmpty();","tryCatchPattern":"try {\n    applyAssigneeFilters(taskQuery, assigneeLike, assigneeIds);\n} catch (FlowableIllegalArgumentException e) {\n    if (!e.getMessage().contains(\"cannot set both taskAssigneeIds and taskAssigneeLike\")) throw e;\n    logger.error(\"Conflicting assignee LIKE and ID filters\", e);\n}","preventionTips":["Build assignee criteria in a single function that picks one filter style.","Prefer ID lists for exact matching and LIKE only for search boxes.","Add unit tests for dynamic filter composition covering conflicting criteria."],"tags":["flowable","task-query","mutually-exclusive","query-usage"],"backgroundTag":"mutually-exclusive-options","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"}