flowable/flowable-engine · error · FlowableObjectNotFoundException
No event definition found for id = '${eventDefinitionId}'
Error message
No event definition found for id = '${eventDefinitionId}' What it means
SetEventDefinitionCategoryCmd throws FlowableObjectNotFoundException when no event definition exists for the given (non-null) id. The lookup findById(eventDefinitionId) returned null, so the category update cannot proceed.
Source
Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/SetEventDefinitionCategoryCmd.java:48
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);
return null;
}
public String getEventDefinitionId() {
return eventDefinitionId;View on GitHub (pinned to d6d39ce1c6)
Solutions
- Look up the definition by key instead: eventRepositoryService.createEventDefinitionQuery().eventDefinitionKey(key).latestVersion().singleResult(), then use its getId().
- Verify the id exists in the same database/engine the command runs against.
- Check whether the event definition was deleted by a prior undeploy/deleteDeployment call.
Example fix
// before
eventRepositoryService.setEventDefinitionCategory("order-event", "billing"); // key, not id
// after
EventDefinition def = eventRepositoryService.createEventDefinitionQuery().eventDefinitionKey("order-event").latestVersion().singleResult();
eventRepositoryService.setEventDefinitionCategory(def.getId(), "billing"); Defensive patterns
Strategy: validation
Validate before calling
EventDefinition def = eventRepositoryService.createEventDefinitionQuery().eventDefinitionId(id).singleResult();
if (def == null) throw new IllegalArgumentException("No event definition for id " + id); Try / catch
try { svc.setEventDefinitionCategory(id, cat); } catch (FlowableObjectNotFoundException e) { /* fall back to key-based lookup */ } Prevention
- Look up by key + latestVersion instead of raw ids
- Verify id belongs to the event registry, not the process/form engine
- Check the definition was not deleted by an undeploy
When it happens
Trigger: Calling setEventDefinitionCategory with an id that does not correspond to any persisted event definition - wrong engine, deleted definition, or id from a different registry (e.g. a form or process definition id).
Common situations: Reusing ids across engines (process vs event registry), referencing definitions removed by an undeploy, environment mismatch (test id used in prod), or key-vs-id confusion (passing the definition key instead of its database id).
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- No event definition found for id = ''
- No event definition found for key ''
- No event definition found for key '${eventDefinitionKey}' fo
- Could not find event model with key '{eventDefinitionKey}'.
- deployment does not exist:
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/db5f065c7755fe9e.
Report an issue: GitHub.