flowable/flowable-engine · error · FlowableIllegalArgumentException
Element id is null
Error message
Element id is null
What it means
Flowable's PlanItemInstanceQuery.planItemInstanceElementId() throws FlowableIllegalArgumentException when the elementId parameter is null. The element id is the XML id of the plan item/element in the CMMN model, used for model-based filtering; null is rejected in the setter before query execution.
Solutions
- Pass a valid CMMN element id as defined in the case model XML
- Make the filter conditional on the value being non-null
- Verify the element id against the deployed case definition (ids change when the model is edited)
Example fix
// before
query.planItemInstanceElementId(elementId); // throws when elementId == null
// after
if (elementId != null) {
query.planItemInstanceElementId(elementId);
} Defensive patterns
Strategy: validation
Validate before calling
if (elementId != null && !elementId.isBlank()) {
query.planItemInstanceElementId(elementId);
} Type guard
boolean isPresent(String id) { return id != null && !id.isBlank(); } Try / catch
try {
query.planItemInstanceElementId(elementId);
} catch (FlowableIllegalArgumentException e) {
log.warn("Element filter skipped: {}", e.getMessage());
} Prevention
- Null-check model/node lookups before using the resolved element id
- Keep element ids used in code/config in sync with the deployed CMMN model
- Treat optional UI selections as 'filter absent', not null
When it happens
Trigger: Calling planItemInstanceElementId(null), commonly when the element id is derived from an expression, a model node reference that didn't resolve, or an optional request parameter that is absent.
Common situations: Code that reads element ids from BPMN/CMMN model introspection where the node lookup fails; UI filtering where the user hasn't selected an element yet; renaming elements in the model while old ids are referenced in code/config.
Related errors
- activatedBefore is null
- assignee is null
- availableAfter is null
- availableBefore is null
- before time is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/8acd622463e6e0cd.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java:206
}
@Override
public PlanItemInstanceQuery planItemInstanceId(String planItemInstanceId) {
if (planItemInstanceId == null) {
throw new FlowableIllegalArgumentException("Plan Item instance id is null");
}
if (inOrStatement) {
this.currentOrQueryObject.planItemInstanceId = planItemInstanceId;
} else {
this.planItemInstanceId = planItemInstanceId;
}
return this;
}
@Override
public PlanItemInstanceQuery planItemInstanceElementId(String elementId) {
if (elementId == null) {
throw new FlowableIllegalArgumentException("Element id is null");
}
if (inOrStatement) {
this.currentOrQueryObject.elementId = elementId;
} else {
this.elementId = elementId;
}
return this;
}
@Override
public PlanItemInstanceQuery planItemDefinitionId(String planItemDefinitionId) {
if (planItemDefinitionId == null) {
throw new FlowableIllegalArgumentException("Plan item definition id is null");
}
if (inOrStatement) {
this.currentOrQueryObject.planItemDefinitionId = planItemDefinitionId;
} else {
this.planItemDefinitionId = planItemDefinitionId;View on GitHub (pinned to d6d39ce1c6)