flowable/flowable-engine · error · FlowableIllegalArgumentException
The event definition id is mandatory, but '' has been…
Error message
The event definition id is mandatory, but '' has been provided.
What it means
The GetEventDefinitionResourceCmd constructor validates its only argument: an event definition id that is null or empty (length < 1) triggers FlowableIllegalArgumentException. This fails fast at command construction rather than inside execute.
Solutions
- Pass a real event definition id (from EventRepositoryService.createEventDefinitionQuery() results)
- Validate non-null and non-empty before constructing the command
- If the id is user-supplied, add API-layer validation rejecting blank ids
Example fix
// before
ew GetEventDefinitionResourceCmd(eventDefinitionId); // may be ""
// after
if (eventDefinitionId == null || eventDefinitionId.trim().isEmpty()) {
throw new IllegalArgumentException("eventDefinitionId is required");
}
new GetEventDefinitionResourceCmd(eventDefinitionId); Defensive patterns
Strategy: validation
Validate before calling
if (eventDefinitionId == null || eventDefinitionId.trim().isEmpty()) {
throw new IllegalArgumentException("eventDefinitionId required");
} Type guard
boolean validId = eventDefinitionId != null && !eventDefinitionId.trim().isEmpty();
Try / catch
try {
InputStream is = new GetEventDefinitionResourceCmd(id).execute(ctx);
} catch (FlowableIllegalArgumentException e) {
log.error("Invalid event definition id: {}", e.getMessage());
} Prevention
- Reject blank ids in controllers/REST layers before reaching the engine
- Trim user-supplied ids and re-validate
- Query createEventDefinitionQuery() to obtain valid ids
When it happens
Trigger: new GetEventDefinitionResourceCmd(null) or new GetEventDefinitionResourceCmd("") — e.g. id read from an empty config field, missing variable, or empty string from a UI/API request.
Common situations: REST call with empty id path param; event definition id column not yet populated; string trimming leaving an empty value; copy-paste of a blank id.
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
- A channel key detection value is required for inbound…
- A channel key detection value is required for the channel…
- A process instance id is required, but the provided id '" +…
- A process instance id is required, but the provided id
- A resource name is mandatory
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/92be9e92777d7de3.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetEventDefinitionResourceCmd.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;
import org.flowable.eventregistry.impl.persistence.entity.EventDefinitionEntity;
import org.flowable.eventregistry.impl.util.CommandContextUtil;
/**
* Gives access to a deployed event model, e.g., an Event definition JSON file, through a stream of bytes.
*
* @author Tijs Rademakers
*/
public class GetEventDefinitionResourceCmd implements Command<InputStream>, Serializable {
private static final long serialVersionUID = 1L;
protected String eventDefinitionId;
public GetEventDefinitionResourceCmd(String eventDefinitionId) {
if (eventDefinitionId == null || eventDefinitionId.length() < 1) {
throw new FlowableIllegalArgumentException("The event definition id is mandatory, but '" + eventDefinitionId + "' has been provided.");
}
this.eventDefinitionId = eventDefinitionId;
}
@Override
public InputStream execute(CommandContext commandContext) {
EventDefinitionEntity eventDefinition = CommandContextUtil.getEventRegistryConfiguration().getDeploymentManager()
.findDeployedEventDefinitionById(eventDefinitionId);
String deploymentId = eventDefinition.getDeploymentId();
String resourceName = eventDefinition.getResourceName();
InputStream eventDefinitionStream = new GetDeploymentResourceCmd(deploymentId, resourceName).execute(commandContext);
return eventDefinitionStream;
}
}
View on GitHub (pinned to d6d39ce1c6)