flowable/flowable-engine · error · ActivitiIllegalArgumentException

event type is null

Error message

event type is null

What it means

ExecutionQuery.eventSubscription(eventType, eventName) requires both a non-null event type (e.g. ActivitiEventType, message/signal) and event name. The library throws ActivitiIllegalArgumentException when eventType is null because filtering by event subscription is meaningless without it, and the value is later written into the persisted query. This is fail-fast argument validation at query-construction time.

Solutions

  1. Pass a valid non-null eventType string as the first argument, e.g. eventSubscription("message", "myMessage").
  2. Check the argument order: the signature is eventSubscription(eventType, eventName); swap the arguments if you passed them reversed.
  3. If the type is sourced dynamically, default it or throw your own descriptive error before calling.
  4. Verify with unit coverage that the configured event type is never null before query execution.

Example fix

// before
String type = config.get("eventType"); // null
query.eventSubscription(type, "orderSignal");
// after
String type = config.get("eventType");
if (type == null) type = "signal"; // or fail early
query.eventSubscription(type, "orderSignal");
Defensive patterns

Strategy: validation

Validate before calling

if (eventType == null) throw new IllegalArgumentException("eventType must be non-null before eventSubscription()");
if (eventName == null) throw new IllegalArgumentException("eventName must be non-null before eventSubscription()");

Type guard

boolean hasEventSubscription(String t, String n) { return t != null && n != null; }

Try / catch

try {
    query.eventSubscription(eventType, eventName);
} catch (ActivitiIllegalArgumentException e) {
    if (e.getMessage().contains("event type is null")) {
        // fix inputs or fall back to non-event-subscription query
    }
}

Prevention

When it happens

Trigger: Calling executionQuery.eventSubscription(null, "someName") — passing eventType as null while eventName is a valid string, often when the type is read from a variable or config that is missing.

Common situations: Dynamically built queries where the event type comes from a user request or properties file; refactorings where argument order (eventType, eventName) was swapped or one parameter dropped; variables that were expected to be initialized but stayed null.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/10b4d7fb363ad9b6. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java:253

        return eventSubscription("signal", signalName);
    }

    @Override
    public ExecutionQuery signalEventSubscriptionName(String signalName) {
        return eventSubscription("signal", signalName);
    }

    @Override
    public ExecutionQuery messageEventSubscriptionName(String messageName) {
        return eventSubscription("message", messageName);
    }

    public ExecutionQuery eventSubscription(String eventType, String eventName) {
        if (eventName == null) {
            throw new ActivitiIllegalArgumentException("event name is null");
        }
        if (eventType == null) {
            throw new ActivitiIllegalArgumentException("event type is null");
        }
        if (eventSubscriptions == null) {
            eventSubscriptions = new ArrayList<>();
        }
        eventSubscriptions.add(new EventSubscriptionQueryValue(eventName, eventType));
        return this;
    }

    @Override
    public ExecutionQuery processVariableValueEquals(String variableName, Object variableValue) {
        return variableValueEquals(variableName, variableValue, false);
    }

    @Override
    public ExecutionQuery processVariableValueEquals(Object variableValue) {
        return variableValueEquals(variableValue, false);
    }

View on GitHub (pinned to d6d39ce1c6)