flowable/flowable-engine · error · ActivitiIllegalArgumentException
Found event definition of unknown type
Error message
Found event definition of unknown type: ${eventType} What it means
EventSubscriptionDeclaration.prepareEventSubscriptionEntity only knows how to materialize 'message' and 'signal' event subscriptions into EventSubscriptionEntity instances. Any other eventType string (e.g. an 'error' or unknown type) reaches the else branch and throws this ActivitiIllegalArgumentException.
Solutions
- Ensure event definitions in your BPMN only declare supported types (messageEventDefinition, signalEventDefinition)
- If you are extending the engine, add a branch for your event type here and create the appropriate EventSubscriptionEntity
- Check the eventType value logged in the exception to trace which declaration produced the bad type
Example fix
// before
EventSubscriptionDeclaration d = new EventSubscriptionDeclaration("error", ...);
EventSubscriptionEntity e = d.prepareEventSubscriptionEntity(execution); // throws
// after: use supported types
EventSubscriptionDeclaration d = new EventSubscriptionDeclaration("signal", ...); Defensive patterns
Strategy: type-guard
Validate before calling
// check declaration type before converting
if (!"message".equals(eventType) && !"signal".equals(eventType)) {
throw new IllegalArgumentException("Unsupported event type: " + eventType);
} Type guard
static boolean isSupportedEventType(String eventType) {
return "message".equals(eventType) || "signal".equals(eventType);
} Try / catch
try {
EventSubscriptionEntity entity = declaration.prepareEventSubscriptionEntity(execution);
} catch (ActivitiIllegalArgumentException e) {
if (e.getMessage().startsWith("Found event definition of unknown type")) { /* inspect eventType */ }
} Prevention
- Only declare messageEventDefinition/signalEventDefinition in BPMN
- If extending event types, extend prepareEventSubscriptionEntity accordingly
- Log the eventType at declaration-creation time to trace bad values
When it happens
Trigger: An EventSubscriptionDeclaration was created with an eventType other than 'message' or 'signal' and is then converted to a subscription entity during execution start/notify; typically a bug or misuse when adding custom event types.
Common situations: Custom engine extensions introducing new event types without updating this factory; corrupted/incorrectly transformed BPMN where an event definition was mapped to the wrong type string.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Cannot have more than one message event subscription with…
- Cannot throw process-instance scoped signal, since the…
- Class does not implement
- Could no handle signal: no start activity found with id
- Could not find matching FlowElement for " +…
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/182f68ea97f04ec1.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/EventSubscriptionDeclaration.java:94
return eventType;
}
public String getConfiguration() {
return configuration;
}
public void setConfiguration(String configuration) {
this.configuration = configuration;
}
public EventSubscriptionEntity prepareEventSubscriptionEntity(ExecutionEntity execution) {
EventSubscriptionEntity eventSubscriptionEntity = null;
if ("message".equals(eventType)) {
eventSubscriptionEntity = new MessageEventSubscriptionEntity(execution);
} else if ("signal".equals(eventType)) {
eventSubscriptionEntity = new SignalEventSubscriptionEntity(execution);
} else {
throw new ActivitiIllegalArgumentException("Found event definition of unknown type: " + eventType);
}
eventSubscriptionEntity.setEventName(eventName);
if (activityId != null) {
ActivityImpl activity = execution.getProcessDefinition().findActivity(activityId);
eventSubscriptionEntity.setActivity(activity);
}
if (configuration != null) {
eventSubscriptionEntity.setConfiguration(configuration);
}
return eventSubscriptionEntity;
}
}
View on GitHub (pinned to d6d39ce1c6)