flowable/flowable-engine · error · FlowableIllegalArgumentException
Parent id is null
Error message
Parent id is null
What it means
HistoricCaseInstanceQueryImpl.caseInstanceParentId() throws FlowableIllegalArgumentException when the parent case instance id is null. The parent id is compared for equality in the generated SQL, so a null value is rejected immediately, before assignment to the query or the current or-query object.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java:526
}
@Override
public HistoricCaseInstanceQueryImpl excludeCaseDefinitionKeys(Set<String> excludeCaseDefinitionKeys) {
if (excludeCaseDefinitionKeys == null) {
throw new FlowableIllegalArgumentException("Case definition keys is null");
}
if (inOrStatement) {
this.currentOrQueryObject.excludeCaseDefinitionKeys = excludeCaseDefinitionKeys;
} else {
this.excludeCaseDefinitionKeys = excludeCaseDefinitionKeys;
}
return this;
}
@Override
public HistoricCaseInstanceQueryImpl caseInstanceParentId(String parentId) {
if (parentId == null) {
throw new FlowableIllegalArgumentException("Parent id is null");
}
if (inOrStatement) {
this.currentOrQueryObject.caseInstanceParentId = parentId;
} else {
this.caseInstanceParentId = parentId;
}
return this;
}
@Override
public HistoricCaseInstanceQuery withoutCaseInstanceParent() {
if (inOrStatement) {
this.currentOrQueryObject.withoutCaseInstanceParentId = true;
} else {
this.withoutCaseInstanceParentId = true;
}
return this;
}View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass a valid parent case instance id string, e.g. caseInstanceParentId(parentCase.getId()).
- Skip the call when parentId is null so the query returns all cases (or handle the 'no parent' case explicitly).
- Validate route/request parameters before building the query and reject the request if the id is required.
- Catch FlowableIllegalArgumentException to return a clear 'parent id required' message.
Example fix
// before
query.caseInstanceParentId(request.getParameter("parentId"));
// after
String parentId = request.getParameter("parentId");
if (parentId != null) {
query.caseInstanceParentId(parentId);
} Defensive patterns
Strategy: validation
Validate before calling
if (parentId != null && !parentId.isBlank()) {
query.caseInstanceParentId(parentId);
} Type guard
boolean hasParentId(String parentId) {
return parentId != null && !parentId.isBlank();
} Try / catch
try {
query.caseInstanceParentId(parentId);
} catch (FlowableIllegalArgumentException e) {
throw new InvalidRequestException("parentId is required for this view");
} Prevention
- Validate route/request parameters before building queries
- Reject requests where a required parent id is missing rather than passing null
- Check lookup results (e.g. parent case existence) before using their ids
- Add tests for deep links with missing parent parameters
When it happens
Trigger: Calling caseInstanceParentId(null), typically when the parent id is derived from a navigation context (e.g. a child-case page whose parent parameter is absent) and passed unconditionally.
Common situations: Parent/child case hierarchies in web apps: a deep link or missing route parameter leaves parentId null; also happens after upgrading integrations where the parent id lookup API started returning null.
Related errors
- query is null
- parentScopeIds is null or empty
- Business status is null
- Case definition keys is null
- Deployment id is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/b4fb2bce1066f5e9.
Report an issue: GitHub.