flowable/flowable-engine · error · FlowableIllegalArgumentException
Empty appsDefinitionIds
Error message
Empty appsDefinitionIds
What it means
FlowableIllegalArgumentException thrown by AppDefinitionQueryImpl.appDefinitionIds when the passed Set is empty. Filtering by an empty id set is rejected because it would produce an invalid/meaningless IN() condition rather than silently matching nothing.
Source
Thrown at modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java:77
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) {
if (categoryLike == null) {
throw new FlowableIllegalArgumentException("categoryLike is null");View on GitHub (pinned to d6d39ce1c6)
Solutions
- Guard with set.isEmpty() and skip the appDefinitionIds() call (and likely return no results directly)
- Ensure the upstream id collection is populated before querying
- If the intent is 'match nothing', short-circuit instead of issuing the query
Example fix
// before
AppDefinitionQuery q = repoService.createAppDefinitionQuery().appDefinitionIds(collectedIds);
// after
if (collectedIds.isEmpty()) { return Collections.emptyList(); }
AppDefinitionQuery q = repoService.createAppDefinitionQuery().appDefinitionIds(collectedIds); Defensive patterns
Strategy: validation
Validate before calling
if (ids == null || ids.isEmpty()) {
return Collections.emptyList(); // nothing can match an empty id set
}
AppDefinitionQuery q = repoService.createAppDefinitionQuery().appDefinitionIds(ids); Type guard
boolean isNonEmpty(Collection<?> c) { return c != null && !c.isEmpty(); } Prevention
- Short-circuit on empty id sets before issuing queries
- Treat 'no candidate ids' as a distinct outcome from 'filter by ids'
- Validate request parameters that feed id filters
When it happens
Trigger: Calling appDefinitionQuery.appDefinitionIds(set) with an empty HashSet — e.g. ids collected from an empty result, an empty request parameter, or a filter that matched nothing upstream.
Common situations: User-provided filter matched no ids; upstream service returned an empty list; batch job ran with no candidates but still built the id-filtered query.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- Set of process instance ids is empty
- scopeIds is empty
- Could not find an app definition with id '<appDefinitionId>
- Could not find a deployment with id '<deploymentId>
- appsDefinitionIds is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/0685eedb086d9bc3.
Report an issue: GitHub.