{"record":{"id":"9ded9ef6d15944cc","repo":"flowable/flowable-engine","slug":"invalid-query-usage-cannot-set-both-tasknameinign-9ded9e","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":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java","lineNumber":303,"sourceCode":"            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    }\n\n    @Override\n    public TaskQueryImpl taskNameLike(String nameLike) {","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L285-L321","documentation":"Thrown by TaskQuery.taskNameInIgnoreCase(Collection) when taskNameLikeIgnoreCase(String) was already set. Both are case-insensitive name matchers but one is a pattern and the other an exact IN list; Flowable treats them as mutually exclusive and throws FlowableIllegalArgumentException immediately.","triggerScenarios":"taskQuery.taskNameLikeIgnoreCase(\"audit%\") then taskQuery.taskNameInIgnoreCase(names) on the same query (or same or() block); fires whenever nameLikeIgnoreCase is non-null at call time.","commonSituations":"Filter refactors from pattern search to list selection where the old call was left in place; configurable query pipelines where both settings can be enabled simultaneously; OR-query construction errors.","solutions":["Keep only one of taskNameLikeIgnoreCase(...) or taskNameInIgnoreCase(...) per query","Prefer taskNameInIgnoreCase when the input is a finite list of names; keep the LIKE only for true prefix/pattern matching","Guard the builder code so setting one clears/overrides the other instead of accumulating both"],"exampleFix":"// before\ntaskQuery.taskNameLikeIgnoreCase(\"audit%\")\n         .taskNameInIgnoreCase(Arrays.asList(\"Audit\", \"Review\"));\n// after\ntaskQuery.taskNameInIgnoreCase(Arrays.asList(\"Audit\", \"Review\"));","handlingStrategy":"validation","validationCode":"if (nameLikeIgnoreCase != null && names != null) {\n    throw new IllegalArgumentException(\"Use either taskNameLikeIgnoreCase or taskNameInIgnoreCase, not both\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    taskService.createTaskQuery().taskNameInIgnoreCase(names).list();\n} catch (FlowableIllegalArgumentException e) {\n    // choose one case-insensitive matcher and rebuild\n}","preventionTips":["Both ignore-case matchers are still mutually exclusive with each other","Make filter setters override rather than accumulate conflicting fields","Centralize name-criterion selection in a single resolver method"],"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"}