{"record":{"id":"c5643e451fb6a7c6","repo":"flowable/flowable-engine","slug":"plan-item-definition-types-is-null-c5643e","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/runtime/PlanItemInstanceQueryImpl.java","lineNumber":245,"sourceCode":"    }\n    \n    @Override\n    public PlanItemInstanceQuery planItemDefinitionType(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 PlanItemInstanceQuery planItemDefinitionTypes(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 PlanItemInstanceQuery planItemInstanceName(String name) {\n        if (name == null) {\n            throw new FlowableIllegalArgumentException(\"Name is null\");\n        }\n        if (inOrStatement) {","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java#L227-L263","documentation":"Thrown by PlanItemInstanceQueryImpl.planItemDefinitionTypes when the list of plan item definition types is null. The query API requires a non-null, non-empty list to build an IN-style filter. Passing null would make the query criteria ambiguous, so the engine fails fast at builder time.","triggerScenarios":"Calling planItemInstanceQuery.planItemDefinitionTypes(null), typically with a list assembled from nullable upstream data (config, request params, a map lookup).","commonSituations":"A REST/GraphQL filter field for types is omitted and the collected list is null; or a helper method returns null instead of an empty list when no types are selected.","solutions":["Pass a non-null list of definition types, e.g. Arrays.asList(\"task\", \"stage\").","Skip the call when the list is null (treat as 'no filter').","Return an empty list (not null) from list-producing helpers, then rely on the empty-check path or skip entirely."],"exampleFix":"// before\nquery.planItemDefinitionTypes(filter.getTypes()); // may be null\n// after\nList<String> types = filter.getTypes();\nif (types != null && !types.isEmpty()) {\n    query.planItemDefinitionTypes(types);\n}","handlingStrategy":"validation","validationCode":"if (types == null || types.isEmpty()) {\n    throw new IllegalArgumentException(\"planItemDefinitionTypes must be non-null and non-empty\");\n}\nplanItemInstanceQuery.planItemDefinitionTypes(types);","typeGuard":"boolean isValidTypesList(List<String> list) {\n    return list != null && !list.isEmpty() && list.stream().allMatch(Objects::nonNull);\n}","tryCatchPattern":"try {\n    query.planItemDefinitionTypes(types);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"Plan item definition types is null\")) {\n        // treat as unfiltered query or reject the request\n    } else {\n        throw e;\n    }\n}","preventionTips":["Return empty lists (never null) from list-producing helpers","Validate multi-select filters at the API boundary before building queries","Use Objects.requireNonNull with a clear message when the list is mandatory"],"tags":["cmmn","query","null-argument","flowable"],"backgroundTag":"null-argument","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"}