{"record":{"id":"9c1c878e3c9293bf","repo":"flowable/flowable-engine","slug":"process-category-list-is-empty-9c1c87","errorCode":null,"errorMessage":"Process category list is empty","messagePattern":"Process category list is empty","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java","lineNumber":297,"sourceCode":"    }\n\n    @Override\n    public HistoricTaskInstanceQuery processDefinitionNameLike(String processDefinitionNameLike) {\n        if (inOrStatement) {\n            this.currentOrQueryObject.processDefinitionNameLike = processDefinitionNameLike;\n        } else {\n            this.processDefinitionNameLike = processDefinitionNameLike;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricTaskInstanceQuery 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 (inOrStatement) {\n            currentOrQueryObject.processCategoryInList = processCategoryInList;\n        } else {\n            this.processCategoryInList = processCategoryInList;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricTaskInstanceQuery processCategoryNotIn(List<String> processCategoryNotInList) {\n        if (processCategoryNotInList == null) {","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java#L279-L315","documentation":"HistoricTaskInstanceQueryImpl.processCategoryIn() throws ActivitiIllegalArgumentException when the category list is non-null but empty. An empty IN clause is invalid, so the library demands at least one category. Provide one or more process definition category values.","triggerScenarios":"Calling historicTaskInstanceQuery.processCategoryIn(new ArrayList<>()) or any empty List<String>.","commonSituations":"Tenant/category selection UI that produced no selections; configuration listing categories that was empty; filtering a category list to empty before passing it.","solutions":["Check !categories.isEmpty() before calling processCategoryIn; skip the call or abort when empty.","Populate the list with the correct process definition category keys.","Verify category configuration/deployment: categories come from deployed process definitions (empty deployments yield empty lists)."],"exampleFix":"// before\nquery.processCategoryIn(selectedCategories); // can be empty\n\n// after\nif (selectedCategories != null && !selectedCategories.isEmpty()) {\n    query.processCategoryIn(selectedCategories);\n}","handlingStrategy":"validation","validationCode":"if (categories != null && !categories.isEmpty()) { query.processCategoryIn(categories); }","typeGuard":"static boolean nonEmpty(List<String> list) { return list != null && !list.isEmpty(); }","tryCatchPattern":"try {\n    query.processCategoryIn(categories);\n} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {\n    return Collections.emptyList(); // empty selection means no matches expected\n}","preventionTips":["Skip the processCategoryIn call when the selection is empty instead of passing an empty list.","Verify deployed process definitions actually carry the category keys you filter on.","Add a validation step in UI/service layers requiring at least one category selection when the filter is active."],"tags":["java","activiti","query-validation","empty-list"],"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"}