flowable/flowable-engine · error · ActivitiIllegalArgumentException
Set of executionIds is empty
Error message
Set of executionIds is empty
What it means
After the null check, GetExecutionsVariablesCmd.execute() rejects an empty executionIds set with ActivitiIllegalArgumentException('Set of executionIds is empty'). A batch variable query with no ids would return nothing meaningful and likely produces an invalid SQL IN clause, so the engine fails fast.
Solutions
- Guard with executionIds.isEmpty() on the caller side and return an empty result without hitting the engine.
- Only call the batch API when you have at least one id; fall back to the single-execution API otherwise.
- Investigate why the id-collection step produced an empty set (upstream query/filters).
Example fix
// before
List<VariableInstance> vars = runtimeService.getVariableInstancesByExecutionIds(ids);
// after
List<VariableInstance> vars = ids == null || ids.isEmpty()
? Collections.emptyList()
: runtimeService.getVariableInstancesByExecutionIds(ids); Defensive patterns
Strategy: validation
Validate before calling
if (executionIds == null || executionIds.isEmpty()) {
return Collections.emptyList(); // skip the batch query entirely
} Type guard
boolean isNonEmpty(Collection<String> c) { return c != null && !c.isEmpty(); } Try / catch
try {
return runtimeService.getVariableInstancesByExecutionIds(executionIds);
} catch (ActivitiIllegalArgumentException e) {
if (e.getMessage().contains("is empty")) { return Collections.emptyList(); }
throw e;
} Prevention
- Short-circuit empty batches before calling the engine.
- Log when filters remove all candidate executions so it's not silent.
- Prefer Set<String> initialized from the source query results to avoid nulls/empties.
When it happens
Trigger: Calling RuntimeService.getVariableInstancesByExecutionIds(Collections.emptySet()) or with a set that was drained/filtered to zero elements; executing the command directly with an empty collection.
Common situations: Filtering removed all candidate executions, a query for active executions returned none, or refactoring changed the population logic so nothing is added to the set.
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 taskIds is empty
- at least one of userId or groups must be provided
- callbackIds is null or empty
- Could not find a deployment with id
- Could not find an app definition with id
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/d1d82c01bb903eac.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/GetExecutionsVariablesCmd.java:45
* @author Daisuke Yoshimoto
*/
public class GetExecutionsVariablesCmd implements Command<List<VariableInstance>>, Serializable {
private static final long serialVersionUID = 1L;
protected Set<String> executionIds;
public GetExecutionsVariablesCmd(Set<String> executionIds) {
this.executionIds = executionIds;
}
@Override
public List<VariableInstance> execute(CommandContext commandContext) {
// Verify existence of executions
if (executionIds == null) {
throw new ActivitiIllegalArgumentException("executionIds is null");
}
if (executionIds.isEmpty()) {
throw new ActivitiIllegalArgumentException("Set of executionIds is empty");
}
List<VariableInstance> instances = new ArrayList<>();
List<VariableInstanceEntity> entities = commandContext.getVariableInstanceEntityManager().findVariableInstancesByExecutionIds(executionIds);
for (VariableInstanceEntity entity : entities) {
entity.getValue();
instances.add(entity);
}
return instances;
}
}
View on GitHub (pinned to d6d39ce1c6)