flowable/flowable-engine · error · FlowableIllegalArgumentException
Event definition id is null
Error message
Event definition id is null
What it means
SetEventDefinitionCategoryCmd throws FlowableIllegalArgumentException when the eventDefinitionId passed to the command is null. This is a fail-fast guard at the start of execute() before any database lookup is attempted.
Solutions
- Ensure a non-null eventDefinitionId is passed; resolve it via EventRepositoryService.createEventDefinitionQuery() first.
- Add a caller-side null/blank check before invoking the command and fail early with your own message.
- Trace where the id originates (config, previous API response) and fix the upstream resolution.
Example fix
// before
eventRepositoryService.setEventDefinitionCategory(eventDefinitionId, "myCategory");
// after
if (eventDefinitionId != null && !eventDefinitionId.isBlank()) {
eventRepositoryService.setEventDefinitionCategory(eventDefinitionId, "myCategory");
} Defensive patterns
Strategy: validation
Validate before calling
if (eventDefinitionId == null || eventDefinitionId.isBlank()) throw new IllegalArgumentException("eventDefinitionId required"); Try / catch
try { svc.setEventDefinitionCategory(id, cat); } catch (FlowableIllegalArgumentException e) { log.error("Null event definition id"); } Prevention
- Null-check ids resolved from earlier queries before passing them on
- Fail fast at DTO/parameter construction boundaries
- Prefer resolving definitions by key in one query step
When it happens
Trigger: Calling eventRepositoryService.setEventDefinitionCategory(null, category) or building SetEventDefinitionCategoryCmd with a null id, typically when the id comes from an unset variable, a failed lookup, or an unpopulated DTO.
Common situations: Programmatically assembling commands where the event definition id was never resolved, copying code from process definitions (same API shape) but passing a process definition id variable that is null, or deserialization producing null fields.
Related errors
- eventDefinitionKey and eventDefinitionId are null
- A channel key detection value is required for the channel…
- A resource name is mandatory
- An event definition key is mandatory
- appsDefinitionIds is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/0d997a6583edcc81.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/SetEventDefinitionCategoryCmd.java:42
/**
* @author Tijs Rademakers
* @author Joram Barrez
*/
public class SetEventDefinitionCategoryCmd implements Command<Void> {
protected String eventDefinitionId;
protected String category;
public SetEventDefinitionCategoryCmd(String eventDefinitionId, String category) {
this.eventDefinitionId = eventDefinitionId;
this.category = category;
}
@Override
public Void execute(CommandContext commandContext) {
if (eventDefinitionId == null) {
throw new FlowableIllegalArgumentException("Event definition id is null");
}
EventDefinitionEntity eventDefinition = CommandContextUtil.getEventDefinitionEntityManager(commandContext).findById(eventDefinitionId);
if (eventDefinition == null) {
throw new FlowableObjectNotFoundException("No event definition found for id = '" + eventDefinitionId + "'");
}
// Update category
eventDefinition.setCategory(category);
// Remove form from cache, it will be refetch later
DeploymentCache<EventDefinitionCacheEntry> eventDefinitionCache = CommandContextUtil.getEventRegistryConfiguration().getEventDefinitionCache();
if (eventDefinitionCache != null) {
eventDefinitionCache.remove(eventDefinitionId);
}
CommandContextUtil.getEventDefinitionEntityManager(commandContext).update(eventDefinition);View on GitHub (pinned to d6d39ce1c6)