flowable/flowable-engine · error · ActivitiIllegalArgumentException
Provided event type is null
Error message
Provided event type is null
What it means
EventSubscriptionQueryImpl.eventType(String) throws ActivitiIllegalArgumentException when the caller passes a null event type. The Flowable query API validates required filter fields eagerly in the fluent setter so an invalid query fails immediately rather than producing a broken SQL query or empty results at list() time. An event type (e.g. 'signal', 'message') is mandatory to scope the event subscription query.
Solutions
- Pass a valid event type string, e.g. query.eventType(EventType.SIGNAL.name()) or a concrete literal like 'signal'.
- Null-check or default the value before calling eventType(): if (type != null) query.eventType(type);
- If the type comes from config, verify the configuration source is actually loaded and the key exists.
- Catch ActivitiIllegalArgumentException to surface a clear message to the user instead of an ambiguous failure.
Example fix
// before
String type = props.getProperty("event.type");
EventSubscriptionQuery q = runtimeService.createEventSubscriptionQuery().eventType(type);
// after
String type = props.getProperty("event.type");
if (type == null) {
throw new ConfigurationException("event.type must be configured");
}
EventSubscriptionQuery q = runtimeService.createEventSubscriptionQuery().eventType(type); Defensive patterns
Strategy: validation
Validate before calling
if (eventType == null || eventType.isEmpty()) {
throw new IllegalArgumentException("eventType must be a non-empty string before calling eventType()");
}
runtimeService.createEventSubscriptionQuery().eventType(eventType); Type guard
boolean isValidEventType(String s) { return s != null && !s.isEmpty(); } Try / catch
try {
query.eventType(eventType);
} catch (ActivitiIllegalArgumentException e) {
log.error("Invalid event subscription query: {}", e.getMessage());
throw new BadRequestException("event type must not be null", e);
} Prevention
- Resolve event types from constants (org.flowable.eventregistry or EventType enum) rather than free-form strings.
- Null-check values loaded from config or maps before feeding them into query builders.
- Centralize query construction in a helper that validates filters first.
- Never chain query setters directly off possibly-null lookups (e.g. map.get(key)).
When it happens
Trigger: Calling eventSubscriptionQuery().eventType(null) — typically eventType(variable) or eventType(someMap.get(key)) where the variable is null or the map lookup missed.
Common situations: Event type stored in configuration/properties that was never loaded; reflection or deserialization building queries from nullable DTO fields; a refactor renamed a constant so the lookup returns null.
Related errors
- Business key is null
- Business status is null
- Case definition category is null
- Case definition id is null
- Case definition ids is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/3f76dd963572e24a.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/EventSubscriptionQueryImpl.java:89
public EventSubscriptionQueryImpl processInstanceId(String processInstanceId) {
if (processInstanceId == null) {
throw new ActivitiIllegalArgumentException("Provided process instance id is null");
}
this.processInstanceId = processInstanceId;
return this;
}
public EventSubscriptionQueryImpl activityId(String activityId) {
if (activityId == null) {
throw new ActivitiIllegalArgumentException("Provided activity id is null");
}
this.activityId = activityId;
return this;
}
public EventSubscriptionQueryImpl eventType(String eventType) {
if (eventType == null) {
throw new ActivitiIllegalArgumentException("Provided event type is null");
}
this.eventType = eventType;
return this;
}
public String getTenantId() {
return tenantId;
}
public EventSubscriptionQueryImpl tenantId(String tenantId) {
this.tenantId = tenantId;
return this;
}
public EventSubscriptionQueryImpl orderByCreated() {
return orderBy(EventSubscriptionQueryProperty.CREATED);
}
View on GitHub (pinned to d6d39ce1c6)