{"record":{"id":"4800bf80ba4e3249","repo":"flowable/flowable-engine","slug":"parent-id-is-null-4800bf","errorCode":null,"errorMessage":"Parent id is null","messagePattern":"Parent id is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java","lineNumber":203,"sourceCode":"        }\n        this.executionId = executionId;\n        return this;\n    }\n\n    @Override\n    public ExecutionQueryImpl activityId(String activityId) {\n        this.activityId = activityId;\n\n        if (activityId != null) {\n            isActive = true;\n        }\n        return this;\n    }\n\n    @Override\n    public ExecutionQueryImpl parentId(String parentId) {\n        if (parentId == null) {\n            throw new ActivitiIllegalArgumentException(\"Parent id is null\");\n        }\n        this.parentId = parentId;\n        return this;\n    }\n\n    @Override\n    public ExecutionQueryImpl executionTenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new ActivitiIllegalArgumentException(\"execution tenant id is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    @Override\n    public ExecutionQueryImpl executionTenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new ActivitiIllegalArgumentException(\"execution tenant id is null\");","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java#L185-L221","documentation":"ExecutionQueryImpl.parentId throws ActivitiIllegalArgumentException when the parentId argument is null. The parent criterion identifies parent executions for child-execution queries and must be a concrete non-null string.","triggerScenarios":"Calling query.parentId(parentExecutionId) with a null parent id, e.g. when the parent execution lookup failed or the caller assumed a default value.","commonSituations":"Fetching child executions of a scope where the parent reference was never established; parallel-branch handling code that derives the parent id from a nullable context field.","solutions":["Ensure the parent execution id is resolved (e.g. via an earlier query) before calling parentId","Do not call parentId when there is no parent filter to apply","Validate the id at the boundary of your service layer with a descriptive error"],"exampleFix":"// before\nquery.parentId(parentId);\n// after\nif (parentId != null) {\n    query.parentId(parentId);\n}","handlingStrategy":"validation","validationCode":"if (parentId != null) { query.parentId(parentId); }","typeGuard":"boolean hasParent = parentId != null && !parentId.isEmpty();","tryCatchPattern":"try { q.parentId(pid); } catch (ActivitiIllegalArgumentException e) { log.warn(\"parentId null\"); }","preventionTips":["Resolve the parent execution before querying children","Apply the parent filter conditionally when hierarchy context exists","Use compile-time-checked wrapper types (e.g. ExecutionId value object) to prevent nulls"],"tags":["java","activiti","query-builder","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"}