{"record":{"id":"689378bf4711e957","repo":"flowable/flowable-engine","slug":"invalid-query-usage-cannot-set-both-tasknameinign-689378","errorCode":null,"errorMessage":"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLike","messagePattern":"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLike","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java","lineNumber":300,"sourceCode":"    @Override\n    public TaskQuery taskNameInIgnoreCase(Collection<String> nameList) {\n        if (nameList == null) {\n            throw new FlowableIllegalArgumentException(\"Task name list is null\");\n        }\n        if (nameList.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Task name list is empty\");\n        }\n        for (String name : nameList) {\n            if (name == null) {\n                throw new FlowableIllegalArgumentException(\"None of the given task names can be null\");\n            }\n        }\n\n        if (name != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskNameInIgnoreCase and name\");\n        }\n        if (nameLike != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLike\");\n        }\n        if (nameLikeIgnoreCase != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskNameInIgnoreCase and nameLikeIgnoreCase\");\n        }\n\n        final int nameListSize = nameList.size();\n        final Collection<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    }","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L282-L318","documentation":"Thrown by TaskQuery.taskNameInIgnoreCase(Collection) when taskNameLike(String) was already set. A LIKE pattern and an ignore-case IN list are alternative, non-combinable name-matching strategies; the API forbids both so the generated SQL stays deterministic. The check runs before the query is stored or executed.","triggerScenarios":"taskQuery.taskNameLike(\"Sign%\") then taskQuery.taskNameInIgnoreCase(names) on the same query or inside one or() block; triggers whenever nameLike is non-null at call time.","commonSituations":"Search screens offering both 'wildcard search' and 'pick from list'; layered filter composition (base query uses LIKE, enhancement adds IN); migrating from taskNameLike to taskNameInIgnoreCase without deleting the old call.","solutions":["Choose one: remove taskNameLike(...) or taskNameInIgnoreCase(...)","Remember taskNameInIgnoreCase already handles case, so it often replaces LIKE-style matching for list inputs","Split into two queries and merge results in application code if both filters are truly needed"],"exampleFix":"// before\ntaskQuery.taskNameLike(\"Sign%\")\n         .taskNameInIgnoreCase(Arrays.asList(\"Sign Off\", \"Review\"));\n// after\ntaskQuery.taskNameInIgnoreCase(Arrays.asList(\"Sign Off\", \"Review\"));","handlingStrategy":"validation","validationCode":"if (nameLike != null && names != null) {\n    throw new IllegalArgumentException(\"Use either taskNameLike or taskNameInIgnoreCase, not both\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    taskService.createTaskQuery().taskNameInIgnoreCase(names).list();\n} catch (FlowableIllegalArgumentException e) {\n    // drop one criterion and rebuild\n}","preventionTips":["Pick LIKE for pattern search, IN for lists — never both","When replacing taskNameLike with taskNameInIgnoreCase, remove the old call","Test composed queries with all filter combinations enabled"],"tags":["flowable","query-usage","task-query","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"}