{"record":{"id":"ddaa2a4e07227070","repo":"flowable/flowable-engine","slug":"planitemdefinitionid-is-null-ddaa2a","errorCode":null,"errorMessage":"planItemDefinitionId is null","messagePattern":"planItemDefinitionId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java","lineNumber":786,"sourceCode":"        }\n        return this;\n    }\n    \n    @Override\n    public CaseInstanceQueryImpl caseInstanceWithoutTenantId() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.withoutTenantId = true;\n        } else {\n            this.withoutTenantId = true;\n        }\n\n        return this;\n    }\n    \n    @Override\n    public CaseInstanceQuery activePlanItemDefinitionId(String planItemDefinitionId) {\n        if (planItemDefinitionId == null) {\n            throw new FlowableIllegalArgumentException(\"planItemDefinitionId is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.activePlanItemDefinitionId = planItemDefinitionId;\n        } else {\n            this.activePlanItemDefinitionId = planItemDefinitionId;\n        }\n        return this;\n    }\n    \n    @Override\n    public CaseInstanceQuery activePlanItemDefinitionIds(Set<String> planItemDefinitionIds) {\n        if (planItemDefinitionIds == null) {\n            throw new FlowableIllegalArgumentException(\"planItemDefinitionIds is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.activePlanItemDefinitionIds = planItemDefinitionIds;\n        } else {\n            this.activePlanItemDefinitionIds = planItemDefinitionIds;","sourceCodeStart":768,"sourceCodeEnd":804,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java#L768-L804","documentation":"FlowableIllegalArgumentException thrown by CaseInstanceQueryImpl.activePlanItemDefinitionId(String) when planItemDefinitionId is null. This filter restricts case instances that currently have an active plan item of the given definition id; null is not a valid definition reference. Pass a real plan item definition id from the case model.","triggerScenarios":"Calling activePlanItemDefinitionId(null) on a CaseInstanceQuery, e.g. when the plan item definition id came from configuration or a lookup that returned null.","commonSituations":"Dashboards showing cases stuck on a specific stage/user event listener where the definition id was not resolved from the CMMN model; wrong key used to fetch the definition.","solutions":["Pass a non-null planItemDefinitionId string.","Skip the filter when no plan item restriction is intended.","Resolve the definition id from the case model/repository service and check for null before querying.","Use the activePlanItemDefinitionId variant (like/ignore-case) appropriate to your data instead of a null."],"exampleFix":"// before\nquery.activePlanItemDefinitionId(config.getPlanItemDefId()); // may be null\n// after\nString defId = config.getPlanItemDefId();\nif (defId != null) {\n    query.activePlanItemDefinitionId(defId);\n}","handlingStrategy":"validation","validationCode":"if (planItemDefinitionId != null) { query.activePlanItemDefinitionId(planItemDefinitionId); }","typeGuard":"boolean isValidDefinitionId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try { query.activePlanItemDefinitionId(defId); } catch (FlowableIllegalArgumentException e) { log.warn(\"planItemDefinitionId null: {}\", e.getMessage()); }","preventionTips":["Resolve plan item definition ids from the CMMN repository and null-check before use.","Validate configuration values that supply definition ids at startup.","Skip plan-item filters when the definition reference is unknown."],"tags":["flowable","cmmn","query","null-check"],"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"}