{"record":{"id":"6a6a0b01f22656db","repo":"flowable/flowable-engine","slug":"invalid-query-usage-cannot-set-both-tasknameinign-6a6a0b","errorCode":null,"errorMessage":"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLikeIgnoreCase","messagePattern":"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLikeIgnoreCase","errorType":"exception","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java","lineNumber":212,"sourceCode":"            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;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQueryImpl taskNameLike(String nameLike) {","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java#L194-L230","documentation":"taskNameLikeIgnoreCase(String) and taskNameInIgnoreCase(...) are both case-insensitive name filters and are mutually exclusive. When taskNameInIgnoreCase finds nameLikeIgnoreCase already set it throws ActivitiIllegalArgumentException rather than producing an ambiguous query.","triggerScenarios":"Chaining taskQuery.taskNameLikeIgnoreCase(\"%review%\").taskNameInIgnoreCase(list), or vice versa on the same query object.","commonSituations":"UI search forms exposing multiple case-insensitive name options where the builder applies all provided values; refactors that swapped one ignore-case filter for the other without removing the first call.","solutions":["Remove the taskNameLikeIgnoreCase(...) call and keep only taskNameInIgnoreCase","Normalize your search criteria to a single name-filter mode before constructing the query","If both semantics are needed, issue two separate queries and merge results"],"exampleFix":"// before\ntaskQuery.taskNameLikeIgnoreCase(\"%review%\").taskNameInIgnoreCase(names);\n// after\ntaskQuery.taskNameInIgnoreCase(names);","handlingStrategy":"validation","validationCode":"if (nameLikeIgnoreCase != null && namesIn != null) {\n    throw new IllegalArgumentException(\"Choose either case-insensitive name-like or name-in filtering, not both\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    query.taskNameLikeIgnoreCase(pattern);\n    query.taskNameInIgnoreCase(names);\n} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {\n    // keep only one case-insensitive filter and rebuild\n}","preventionTips":["Standardize on one ignore-case name filter in your query layer","When refactoring between Like and In variants, delete the superseded call","Add unit tests covering each name-filter combination you support"],"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-18T16:30:33.424Z"}