flowable/flowable-engine · error · FlowableIllegalArgumentException
appsDefinitionIds is null
Error message
appsDefinitionIds is null
What it means
FlowableIllegalArgumentException thrown by AppDefinitionQueryImpl.appDefinitionIds when the Set of app definition ids passed is null. The query builder requires a non-null, non-empty set to filter on.
Source
Thrown at modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java:75
public AppDefinitionQueryImpl(CommandContext commandContext) {
super(commandContext);
}
public AppDefinitionQueryImpl(CommandExecutor commandExecutor) {
super(commandExecutor);
}
@Override
public AppDefinitionQueryImpl appDefinitionId(String appDefinitionId) {
this.id = appDefinitionId;
return this;
}
@Override
public AppDefinitionQuery appDefinitionIds(Set<String> appsDefinitionIds) {
if (appsDefinitionIds == null) {
throw new FlowableIllegalArgumentException("appsDefinitionIds is null");
} else if (appsDefinitionIds.isEmpty()) {
throw new FlowableIllegalArgumentException("Empty appsDefinitionIds");
}
this.ids = appsDefinitionIds;
return this;
}
@Override
public AppDefinitionQueryImpl appDefinitionCategory(String category) {
if (category == null) {
throw new FlowableIllegalArgumentException("category is null");
}
this.category = category;
return this;
}
@Override
public AppDefinitionQueryImpl appDefinitionCategoryLike(String categoryLike) {View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass a non-null Set of ids; if there is nothing to filter, skip the appDefinitionIds() call entirely
- Null-check or default the set at the call site before building the query
- Coalesce null to an empty collection and branch on it
Example fix
// before
query.appDefinitionIds(idsById.get(appKey)); // may be null
// after
Set<String> ids = idsById.getOrDefault(appKey, Collections.emptySet());
if (!ids.isEmpty()) { query.appDefinitionIds(ids); } Defensive patterns
Strategy: type-guard
Validate before calling
if (ids != null && !ids.isEmpty()) {
query.appDefinitionIds(ids);
} Type guard
boolean isValidIdSet(Set<String> ids) { return ids != null && !ids.isEmpty(); } Try / catch
try {
query.appDefinitionIds(ids);
} catch (FlowableIllegalArgumentException e) {
// fall back to unfiltered query or propagate validation error
} Prevention
- Initialize id sets with Collections.emptySet() instead of null
- Null-check values from upstream lookups before query building
- Add unit tests for query builders with null/empty inputs
When it happens
Trigger: Calling appDefinitionQuery.appDefinitionIds(null) while building an AppDefinitionQuery, typically when the id set comes from an upstream call or map lookup that returned null.
Common situations: Upstream list/map lookup produced null instead of an empty set; variable holding ids was never initialized; refactored code where a default set was removed.
Related errors
- category is null
- query is null
- parentScopeIds is null or empty
- Business status is null
- Case definition keys is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/4256b28ba07603a3.
Report an issue: GitHub.