flowable/flowable-engine · error · FlowableIllegalArgumentException
caseInstanceIds are null
Error message
caseInstanceIds are null
What it means
BulkDeleteCaseInstancesCmd.execute throws FlowableIllegalArgumentException when the caseInstanceIds collection is null. Bulk commands delegate to DeleteCaseInstanceCmd per id, so a null collection cannot be iterated; the command fails fast with a clear message.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/BulkDeleteCaseInstancesCmd.java:37
import org.flowable.common.engine.api.FlowableIllegalArgumentException;
import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
/**
* @author Christopher Welsch
*/
public class BulkDeleteCaseInstancesCmd implements Command<Void> {
protected Collection<String> caseInstanceIds;
public BulkDeleteCaseInstancesCmd(Collection<String> caseInstanceIds) {
this.caseInstanceIds = caseInstanceIds;
}
@Override
public Void execute(CommandContext commandContext) {
if (caseInstanceIds == null) {
throw new FlowableIllegalArgumentException("caseInstanceIds are null");
}
Set<String> instanceIdSet = new HashSet<>(caseInstanceIds);
for (String instanceId : instanceIdSet) {
DeleteCaseInstanceCmd command = new DeleteCaseInstanceCmd(instanceId);
command.execute(commandContext);
}
return null;
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass a non-null collection (an empty list is fine) to bulkDeleteCaseInstances
- Coalesce null to Collections.emptyList() at the call site
- Guard the call: only invoke bulk delete when the id list was actually populated
Example fix
// before cmmnRuntimeService.bulkDeleteCaseInstances(ids); // ids may be null // after cmmnRuntimeService.bulkDeleteCaseInstances(ids == null ? Collections.emptyList() : ids);
Defensive patterns
Strategy: type-guard
Validate before calling
if (caseInstanceIds == null) caseInstanceIds = Collections.emptyList();
Type guard
boolean isNonNullCollection(Collection<?> c) { return c != null; } Try / catch
try {
cmmnRuntimeService.bulkDeleteCaseInstances(ids);
} catch (FlowableIllegalArgumentException e) {
log.error("Bulk delete rejected: {}", e.getMessage());
} Prevention
- Never return null collections from your id-gathering methods — return empty lists
- Coalesce nulls at API boundaries
- Enable static analysis nullness checks (e.g. NullAway)
When it happens
Trigger: Calling cmmnRuntimeService.bulkDeleteCaseInstances(null) or constructing BulkDeleteCaseInstancesCmd with a null collection — e.g. an upstream query that returned null instead of an empty list.
Common situations: A repository/service method returning null when no ids matched; deserialization of an empty request body into a null field; unguarded variable passing.
Related errors
- historic case instanceIds are null
- tasks are null
- caseInstanceIds are null
- caseInstanceId is null
- variable name is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/105a360c3faa405c.
Report an issue: GitHub.