{"record":{"id":"4e7a4b39f8870fce","repo":"flowable/flowable-engine","slug":"parentprocessinstanceid-is-null","errorCode":null,"errorMessage":"parentProcessInstanceId is null","messagePattern":"parentProcessInstanceId is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java","lineNumber":783,"sourceCode":"    }\n    \n    @Override\n    public HistoricCaseInstanceQuery parentCaseInstanceId(String parentCaseInstanceId) {\n        if (parentCaseInstanceId == null) {\n            throw new FlowableIllegalArgumentException(\"parent case instance id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.parentCaseInstanceId = parentCaseInstanceId;\n        } else {\n            this.parentCaseInstanceId = parentCaseInstanceId;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricCaseInstanceQuery parentProcessInstanceId(String parentProcessInstanceId) {\n        if (parentProcessInstanceId == null) {\n            throw new FlowableIllegalArgumentException(\"parentProcessInstanceId is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.parentProcessInstanceId = parentProcessInstanceId;\n        } else {\n            this.parentProcessInstanceId = parentProcessInstanceId;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricCaseInstanceQuery withoutCaseInstanceCallbackId() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.withoutCallbackId = true;\n        } else {\n            this.withoutCallbackId = true;\n        }\n        return this;\n    }","sourceCodeStart":765,"sourceCodeEnd":801,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java#L765-L801","documentation":"HistoricCaseInstanceQueryImpl.parentProcessInstanceId(String) rejects a null parentProcessInstanceId. The value is stored as an equality filter over the parent process instance id of the historic case instance, and null is not a valid criterion, so FlowableIllegalArgumentException is thrown during query construction.","triggerScenarios":"Calling parentProcessInstanceId(null) on a HistoricCaseInstanceQuery, usually because the parent process instance id was fetched from an execution/variable that was null (e.g. the case instance was not started by a process).","commonSituations":"Correlating CMMN case instances with a calling BPMN process when the case was started standalone; passing entity.getId() of a parent that failed to load; REST payloads missing the parentProcessInstanceId field mapped straight into the query.","solutions":["Pass a non-null parent process instance id.","Only add the parentProcessInstanceId filter when the caller actually came from a process (guard with a null check).","For standalone case instances, use a query that does not filter on parent process instance at all."],"exampleFix":"// before\nquery.parentProcessInstanceId(processInstanceId);\n// after\nif (processInstanceId != null) {\n    query.parentProcessInstanceId(processInstanceId);\n}","handlingStrategy":"validation","validationCode":"if (parentProcessInstanceId != null) {\n    query.parentProcessInstanceId(parentProcessInstanceId);\n}","typeGuard":"boolean hasParentProcess(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try {\n    query.parentProcessInstanceId(pid);\n} catch (FlowableIllegalArgumentException e) {\n    // case instance was not started from a process; drop the filter\n}","preventionTips":["Check whether the case instance actually originated from a BPMN process before filtering on parent process id.","Treat optional correlation ids as conditional filters, not required ones.","Validate REST payload fields at the controller layer."],"tags":["null-argument","query","cmmn","validation"],"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"}