{"record":{"id":"3b815a5f17a97d41","repo":"flowable/flowable-engine","slug":"process-category-list-is-empty-3b815a","errorCode":null,"errorMessage":"Process category list is empty","messagePattern":"Process category list is empty","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java","lineNumber":1035,"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(List<String> processCategoryInList) {\n        if (processCategoryInList == null) {\n            throw new ActivitiIllegalArgumentException(\"Process category list is null\");\n        }\n        if (processCategoryInList.isEmpty()) {\n            throw new ActivitiIllegalArgumentException(\"Process category list is empty\");\n        }\n        for (String processCategory : processCategoryInList) {\n            if (processCategory == null) {\n                throw new ActivitiIllegalArgumentException(\"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(List<String> processCategoryNotInList) {\n        if (processCategoryNotInList == null) {","sourceCodeStart":1017,"sourceCodeEnd":1053,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java#L1017-L1053","documentation":"TaskQueryImpl.processCategoryIn(List<String>) throws ActivitiIllegalArgumentException when the processCategoryInList is empty. An empty category list would produce a meaningless SQL IN () predicate, so the engine rejects it eagerly while the query is being built.","triggerScenarios":"Calling taskQuery.processCategoryIn(new ArrayList<>()) or passing a list whose entries were all filtered out before the query was assembled.","commonSituations":"Users deselecting all category filters in a UI; config-driven category sets that resolve to zero entries in a given environment.","solutions":["Check isEmpty() before calling processCategoryIn; skip the filter (all categories) or short-circuit to an empty result depending on business rules.","Combine null/empty handling into a shared guard used by all in-list query filters.","Catch ActivitiIllegalArgumentException and return 'no categories selected' feedback to the user."],"exampleFix":"// before\ntaskQuery.processCategoryIn(selectedCategories); // may be empty\n\n// after\nif (selectedCategories == null || selectedCategories.isEmpty()) {\n    // no category filter selected\n} else {\n    taskQuery.processCategoryIn(selectedCategories);\n}","handlingStrategy":"validation","validationCode":"if (selectedCategories == null || selectedCategories.isEmpty()) {\n    // all categories selected: do not apply filter\n} else {\n    taskQuery.processCategoryIn(selectedCategories);\n}","typeGuard":"boolean isNonEmptyCategoryList(List<String> categories) { return categories != null && !categories.isEmpty(); }","tryCatchPattern":"try {\n    return taskQuery.processCategoryIn(categories).list();\n} catch (ActivitiIllegalArgumentException e) {\n    log.warn(\"Empty category list rejected: {}\", e.getMessage());\n    return Collections.emptyList();\n}","preventionTips":["Map 'nothing selected' in UIs to an explicit unfiltered query","Check both null and empty before applying in-list filters","Document whether empty selection means 'all' or 'none' per business rule"],"tags":["activiti","flowable","task-query","argument-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"}