{"record":{"id":"a6462747393df08c","repo":"flowable/flowable-engine","slug":"plan-item-definition-type-is-null-a64627","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/runtime/PlanItemInstanceQueryImpl.java","lineNumber":232,"sourceCode":"    }\n    \n    @Override\n    public PlanItemInstanceQuery planItemDefinitionId(String planItemDefinitionId) {\n        if (planItemDefinitionId == null) {\n            throw new FlowableIllegalArgumentException(\"Plan item definition id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.planItemDefinitionId = planItemDefinitionId;\n        } else {\n            this.planItemDefinitionId = planItemDefinitionId;\n        }\n        return this;\n    }\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) {","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java#L214-L250","documentation":"This FlowableIllegalArgumentException is thrown by PlanItemInstanceQueryImpl.planItemDefinitionType when a null plan item definition type is passed. The CMMN engine query API rejects null filter values eagerly at query-construction time rather than producing an ambiguous SQL query later. It is a programmer-error guard: the filter must be a concrete string such as 'humanTask' or 'task'.","triggerScenarios":"Calling planItemInstanceQuery.planItemDefinitionType(null), or passing a variable/field that resolves to null into it while building a PlanItemInstanceQuery.","commonSituations":"Developers building dynamic query criteria from optional request parameters (e.g. a REST query param that is absent) and passing the unboxed null straight into the query builder.","solutions":["Pass a concrete plan item definition type string (e.g. \"task\", \"humanTask\", \"stage\", \"milestone\", \"eventListener\").","Guard the call: only invoke planItemDefinitionType when the value is non-null; otherwise skip the filter.","If the intent was a multi-value filter, use planItemDefinitionTypes(List<String>) with a non-empty list."],"exampleFix":"// before\nquery.planItemDefinitionType(request.getType()); // type may be null\n// after\nif (request.getType() != null) {\n    query.planItemDefinitionType(request.getType());\n}","handlingStrategy":"validation","validationCode":"if (type == null || type.isBlank()) {\n    throw new IllegalArgumentException(\"planItemDefinitionType must be a non-null, non-empty string\");\n}\nplanItemInstanceQuery.planItemDefinitionType(type);","typeGuard":"boolean isValidDefinitionType(String s) {\n    return s != null && !s.isBlank();\n}","tryCatchPattern":"try {\n    query.planItemDefinitionType(type);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"Plan item definition type is null\")) {\n        // skip filter or surface a 400 to the caller\n    } else {\n        throw e;\n    }\n}","preventionTips":["Null-check every optional query parameter before passing it into a query builder method","Prefer typed constants for plan item definition types instead of free-form strings","Skip filters rather than passing placeholder null values"],"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"}