{"record":{"id":"576311871fafe955","repo":"flowable/flowable-engine","slug":"invalid-query-usage-cannot-set-both-tasknameinign-576311","errorCode":null,"errorMessage":"Invalid query usage: cannot set both taskNameInIgnoreCase and name","messagePattern":"Invalid query usage: cannot set both taskNameInIgnoreCase and name","errorType":"exception","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java","lineNumber":206,"sourceCode":"        return this;\n    }\n\n    @Override\n    public TaskQuery taskNameInIgnoreCase(List<String> nameList) {\n        if (nameList == null) {\n            throw new ActivitiIllegalArgumentException(\"Task name list is null\");\n        }\n        if (nameList.isEmpty()) {\n            throw new ActivitiIllegalArgumentException(\"Task name list is empty\");\n        }\n        for (String name : nameList) {\n            if (name == null) {\n                throw new ActivitiIllegalArgumentException(\"None of the given task names can be null\");\n            }\n        }\n\n        if (name != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskNameInIgnoreCase and name\");\n        }\n        if (nameLike != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLike\");\n        }\n        if (nameLikeIgnoreCase != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLikeIgnoreCase\");\n        }\n\n        final int nameListSize = nameList.size();\n        final List<String> caseIgnoredNameList = new ArrayList<>(nameListSize);\n        for (String name : nameList) {\n            caseIgnoredNameList.add(name.toLowerCase());\n        }\n\n        if (orActive) {\n            this.currentOrQueryObject.nameListIgnoreCase = caseIgnoredNameList;\n        } else {\n            this.nameListIgnoreCase = caseIgnoredNameList;","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java#L188-L224","documentation":"Activiti task queries allow only one name filter at a time. Once taskName(String) has set the exact `name` criterion, calling taskNameInIgnoreCase(...) would create conflicting conditions, so the engine throws ActivitiIllegalArgumentException at query build time.","triggerScenarios":"Chaining taskQuery.taskName(\"foo\").taskNameInIgnoreCase(list) (or calling taskNameInIgnoreCase when orQuery `name` is set) on the same TaskQuery object.","commonSituations":"Composing query criteria dynamically from a search DTO where both exactName and nameIn fields were provided by the caller; copy-paste reuse of a base query object that already had taskName set.","solutions":["Remove the taskName(...) call so only taskNameInIgnoreCase is applied","Decide which filter wins in your API layer and reject requests that supply both before building the query","Build a fresh TaskQuery instance per filter mode instead of mutating a shared one"],"exampleFix":"// before\ntaskQuery.taskName(\"review\").taskNameInIgnoreCase(names);\n// after\ntaskQuery.taskNameInIgnoreCase(names); // drop the exact-name filter","handlingStrategy":"validation","validationCode":"if (exactName != null && namesIn != null) {\n    throw new IllegalArgumentException(\"Provide either an exact task name or a name list, not both\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    buildTaskQuery(criteria);\n} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {\n    throw new InvalidSearchCriteriaException(e.getMessage());\n}","preventionTips":["Enforce one-name-filter semantics in your search DTO validation","Build a fresh TaskQuery per request instead of reusing/mutating one","Centralize criteria-to-query mapping so conflicts are caught in one place"],"tags":["activiti","task-query","invalid-usage","mutually-exclusive"],"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"}