{"record":{"id":"9cb6527105915899","repo":"flowable/flowable-engine","slug":"process-category-list-is-empty-9cb652","errorCode":null,"errorMessage":"Process category list is empty","messagePattern":"Process category list is empty","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java","lineNumber":1735,"sourceCode":"    }\n\n    @Override\n    public TaskQuery processDefinitionNameLike(String processDefinitionNameLike) {\n        if (orActive) {\n            currentOrQueryObject.processDefinitionNameLike = processDefinitionNameLike;\n        } else {\n            this.processDefinitionNameLike = processDefinitionNameLike;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery processCategoryIn(Collection<String> processCategoryInList) {\n        if (processCategoryInList == null) {\n            throw new FlowableIllegalArgumentException(\"Process category list is null\");\n        }\n        if (processCategoryInList.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Process category list is empty\");\n        }\n        for (String processCategory : processCategoryInList) {\n            if (processCategory == null) {\n                throw new FlowableIllegalArgumentException(\"None of the given process categories can be null\");\n            }\n        }\n\n        if (orActive) {\n            currentOrQueryObject.processCategoryInList = processCategoryInList;\n        } else {\n            this.processCategoryInList = processCategoryInList;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery processCategoryNotIn(Collection<String> processCategoryNotInList) {\n        if (processCategoryNotInList == null) {","sourceCodeStart":1717,"sourceCodeEnd":1753,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L1717-L1753","documentation":"TaskQueryImpl.processCategoryIn() rejects an empty collection with FlowableIllegalArgumentException. An empty IN list would produce invalid or never-matching SQL, so Flowable fails fast instead of returning misleading empty results.","triggerScenarios":"Calling processCategoryIn(Collections.emptyList()) or with a collection that had all elements removed before the query was built.","commonSituations":"Category list loaded from config/database that came back empty; user deselected all categories in a UI and the code still applies the filter.","solutions":["Check !categories.isEmpty() before calling processCategoryIn","Omit the filter entirely when the list is empty","Provide at least one category, or use a different query path for 'any category'"],"exampleFix":"// before\nquery.processCategoryIn(selectedCategories); // throws when empty\n// after\nif (selectedCategories != null && !selectedCategories.isEmpty()) {\n    query.processCategoryIn(selectedCategories);\n}","handlingStrategy":"validation","validationCode":"if (selectedCategories != null && !selectedCategories.isEmpty()) {\n    query.processCategoryIn(selectedCategories);\n}","typeGuard":"boolean isUsableCategoryList(Collection<String> c) { return c != null && !c.isEmpty(); }","tryCatchPattern":"try {\n    query.processCategoryIn(selectedCategories);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"list is empty\")) { /* omit filter */ }\n    else throw e;\n}","preventionTips":["Skip collection criteria when the collection is empty","Never call IN-style filters with empty lists","Decide explicitly what 'no categories selected' means in your query layer"],"tags":["flowable","task-query","empty-collection","validation"],"backgroundTag":"empty-required-field","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"}