{"record":{"id":"d1145ac05f3dcdfd","repo":"flowable/flowable-engine","slug":"plan-item-definition-type-is-null","errorCode":null,"errorMessage":"Plan item definition type is null","messagePattern":"Plan item definition type 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":228,"sourceCode":"            this.elementId = elementId;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricPlanItemInstanceQuery planItemInstanceDefinitionId(String planItemDefinitionId) {\n        if (inOrStatement) {\n            this.currentOrQueryObject.planItemDefinitionId = planItemDefinitionId;\n        } else {\n            this.planItemDefinitionId = planItemDefinitionId;\n        }\n        return this;\n    }\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) {","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricPlanItemInstanceQueryImpl.java#L210-L246","documentation":"HistoricPlanItemInstanceQueryImpl.planItemInstanceDefinitionType() rejects a null planItemDefinitionType with FlowableIllegalArgumentException. The definition type (e.g. 'humanTask', 'userEventListener') must be a concrete string for the filter.","triggerScenarios":"Calling planItemInstanceDefinitionType(null), usually from a config value, enum lookup, or request parameter that is null.","commonSituations":"Mapping UI filter selections to CMMN plan item definition types where no selection maps to null; typos in constants resolved via reflection/maps.","solutions":["Null-check the type before calling and skip the filter when null","Pass a valid plan item definition type string (e.g. \"humanTask\")","Use planItemInstanceDefinitionTypes(List) when multiple types may apply and omit the filter if the list is empty","Fix the constant/config source that resolves to null"],"exampleFix":"// before\nquery.planItemInstanceDefinitionType(type).list();\n// after\nif (type != null) {\n    query.planItemInstanceDefinitionType(type);\n}\nList<HistoricPlanItemInstance> results = query.list();","handlingStrategy":"validation","validationCode":"if (planItemDefinitionType != null) {\n    query.planItemInstanceDefinitionType(planItemDefinitionType);\n}","typeGuard":"boolean hasType(String t) { return t != null && !t.isEmpty(); }","tryCatchPattern":"try {\n    query.planItemInstanceDefinitionType(type);\n} catch (FlowableIllegalArgumentException e) {\n    if (!e.getMessage().contains(\"Plan item definition type is null\")) throw e;\n    // proceed without the type filter\n}","preventionTips":["Use named constants/enums for plan item definition types instead of raw strings from maps","Null-check config-driven or user-selected type values before filtering","Prefer the plural types() variant with a checked list when types are optional"],"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"}