{"record":{"id":"4b17065789103c92","repo":"flowable/flowable-engine","slug":"invalid-query-usage-cannot-set-both-tasknameinign-4b1706","errorCode":null,"errorMessage":"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLikeIgnoreCase","messagePattern":"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLikeIgnoreCase","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java","lineNumber":423,"sourceCode":"            throw new ActivitiIllegalArgumentException(\"Task name list is null\");\n        }\n        if (taskNameList.isEmpty()) {\n            throw new ActivitiIllegalArgumentException(\"Task name list is empty\");\n        }\n        for (String taskName : taskNameList) {\n            if (taskName == null) {\n                throw new ActivitiIllegalArgumentException(\"None of the given task names can be null\");\n            }\n        }\n\n        if (taskName != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskNameInIgnoreCase and name\");\n        }\n        if (taskNameLike != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLike\");\n        }\n        if (taskNameLikeIgnoreCase != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLikeIgnoreCase\");\n        }\n\n        final int nameListSize = taskNameList.size();\n        final List<String> caseIgnoredTaskNameList = new ArrayList<>(nameListSize);\n        for (String taskName : taskNameList) {\n            caseIgnoredTaskNameList.add(taskName.toLowerCase());\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.taskNameListIgnoreCase = caseIgnoredTaskNameList;\n        } else {\n            this.taskNameListIgnoreCase = caseIgnoredTaskNameList;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricTaskInstanceQuery taskNameLike(String taskNameLike) {","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java#L405-L441","documentation":"taskNameInIgnoreCase also rejects combination with taskNameLikeIgnoreCase. If the case-insensitive LIKE filter is already set, the setter throws ActivitiIllegalArgumentException to prevent two conflicting name criteria.","triggerScenarios":"Calling .taskNameInIgnoreCase(List<String>) after .taskNameLikeIgnoreCase(\"review%\") on the same HistoricTaskInstanceQuery.","commonSituations":"Migration from LIKE-based filtering to IN-list filtering (e.g. after a version change exposing taskNameInIgnoreCase) where the old filter call was not removed.","solutions":["Remove the taskNameLikeIgnoreCase call; taskNameInIgnoreCase already performs case-insensitive exact matching.","If pattern semantics are truly needed, keep only taskNameLikeIgnoreCase and do not call the IN variant.","Refactor query construction so name filters are set in exactly one place."],"exampleFix":"// before\nquery.taskNameLikeIgnoreCase(\"review%\");\nquery.taskNameInIgnoreCase(names);\n// after\nquery.taskNameInIgnoreCase(names);","handlingStrategy":"validation","validationCode":"if (caseInsensitivePattern != null) {\n    query.taskNameLikeIgnoreCase(caseInsensitivePattern);\n} else if (names != null && !names.isEmpty()) {\n    query.taskNameInIgnoreCase(names);\n}","typeGuard":"boolean canUseTaskNameInIgnoreCase(HistoricTaskInstanceQueryImpl q) { return q.getTaskNameLikeIgnoreCase() == null; }","tryCatchPattern":"try {\n    query.taskNameInIgnoreCase(names);\n} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {\n    // taskNameLikeIgnoreCase already set — rebuild with a single name filter\n    query = taskService.createHistoricTaskInstanceQuery().taskNameInIgnoreCase(names);\n}","preventionTips":["Remember taskNameInIgnoreCase already ignores case — taskNameLikeIgnoreCase is unnecessary with it.","After migrating to IN-list filters, remove legacy LIKE calls.","Keep name filtering in a single code path."],"tags":["flowable","query","invalid-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-18T16:17:23.245Z"}