{"record":{"id":"b927f702239aceec","repo":"flowable/flowable-engine","slug":"plan-item-definition-types-is-null","errorCode":null,"errorMessage":"Plan item definition types is null","messagePattern":"Plan item definition types is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricPlanItemInstanceQueryImpl.java","lineNumber":241,"sourceCode":"    }\n\n    @Override\n    public HistoricPlanItemInstanceQuery planItemInstanceDefinitionType(String planItemDefinitionType) {\n        if (planItemDefinitionType == null) {\n            throw new FlowableIllegalArgumentException(\"Plan item definition type is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.planItemDefinitionType = planItemDefinitionType;\n        } else {\n            this.planItemDefinitionType = planItemDefinitionType;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricPlanItemInstanceQuery planItemInstanceDefinitionTypes(List<String> planItemDefinitionTypes) {\n        if (planItemDefinitionTypes == null) {\n            throw new FlowableIllegalArgumentException(\"Plan item definition types is null\");\n        }\n        if (planItemDefinitionTypes.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Plan item definition types is empty\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.planItemDefinitionTypes = planItemDefinitionTypes;\n        } else {\n            this.planItemDefinitionTypes = planItemDefinitionTypes;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricPlanItemInstanceQuery planItemInstanceStartUserId(String startUserId) {\n        if (inOrStatement) {\n            this.currentOrQueryObject.startUserId = startUserId;\n        } else {\n            this.startUserId = startUserId;","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricPlanItemInstanceQueryImpl.java#L223-L259","documentation":"HistoricPlanItemInstanceQueryImpl.planItemInstanceDefinitionTypes() requires a non-null List of plan item definition types; null raises FlowableIllegalArgumentException because the filter cannot distinguish null from an intentional no-filter.","triggerScenarios":"Calling planItemInstanceDefinitionTypes(null), typically from an uninitialized collection variable or a deserialized payload missing the field.","commonSituations":"REST request bodies omitting the types array; Optional misuse producing null instead of a default list.","solutions":["Null-check the list before calling and skip the filter when null","Initialize to an empty List and only call the method when non-empty","Use planItemInstanceDefinitionType for a single type instead of a list","Fix the deserialization/upstream code so the list is populated"],"exampleFix":"// before\nquery.planItemInstanceDefinitionTypes(types).list();\n// after\nif (types != null && !types.isEmpty()) {\n    query.planItemInstanceDefinitionTypes(types);\n}\nList<HistoricPlanItemInstance> results = query.list();","handlingStrategy":"validation","validationCode":"if (types != null && !types.isEmpty()) {\n    query.planItemInstanceDefinitionTypes(types);\n}","typeGuard":"boolean isUsableTypeList(List<String> l) { return l != null && !l.isEmpty(); }","tryCatchPattern":"try {\n    query.planItemInstanceDefinitionTypes(types);\n} catch (FlowableIllegalArgumentException e) {\n    if (!e.getMessage().contains(\"Plan item definition types is null\")) throw e;\n    // proceed without the types filter\n}","preventionTips":["Deserialize request payloads with default empty lists instead of null","Apply Optional.orElse(Collections.emptyList()) when deriving the list","Only call list-filter methods with non-null, non-empty lists"],"tags":["flowable","cmmn","query-api","null-argument"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}