flowable/flowable-engine · error · FlowableObjectNotFoundException

eventDefinitionKey and eventDefinitionId are null

Error message

eventDefinitionKey and eventDefinitionId are null

What it means

GetEventModelCmd.execute() requires at least one lookup identifier. When both eventDefinitionKey and eventDefinitionId are null it throws FlowableObjectNotFoundException immediately, before any database access, because there is no way to identify the event definition.

Solutions

  1. Ensure the caller sets either eventDefinitionId or eventDefinitionKey before invoking the lookup.
  2. Fix the configuration source so the key/id is populated (check for empty strings or unresolved placeholders).
  3. Validate inputs in your service layer and fail fast with a clear message before calling the engine.

Example fix

// before
GetEventModelCmd cmd = new GetEventModelCmd(null, null, null, null); // both id and key null
// after
if (eventDefinitionKey == null && eventDefinitionId == null) {
    throw new IllegalArgumentException("eventDefinitionKey or eventDefinitionId must be provided");
}
GetEventModelCmd cmd = new GetEventModelCmd(eventDefinitionId, eventDefinitionKey, null, null);
Defensive patterns

Strategy: validation

Validate before calling

if (eventDefinitionId == null && (eventDefinitionKey == null || eventDefinitionKey.isBlank())) {
    throw new IllegalArgumentException("Provide eventDefinitionId or eventDefinitionKey");
}

Type guard

boolean hasIdentifier(String id, String key) {
    return id != null || (key != null && !key.isBlank());
}

Try / catch

try {
    return eventRepositoryService.getEventModelByKey(key);
} catch (FlowableObjectNotFoundException e) {
    throw new ConfigurationException("Event lookup called without id/key; check config", e);
}

Prevention

When it happens

Trigger: Constructing GetEventModelCmd (or calling the repository API that delegates to it) with neither an event definition id nor key supplied, e.g. passing a null/empty variable from configuration into the command.

Common situations: Configuration property not set or a YAML/properties placeholder left unresolved; an API caller that conditionally sets id or key but the condition matched neither; a bug where the wrong variable is passed.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetEventModelCmd.java:144

                eventDefinitionEntity = eventDefinitionEntityManager.findLatestEventDefinitionByKeyAndTenantId(eventDefinitionKey, tenantId);
            }
            
            if (eventDefinitionEntity == null && eventEngineConfiguration.isFallbackToDefaultTenant()) {
                String defaultTenant = eventEngineConfiguration.getDefaultTenantProvider().getDefaultTenant(tenantId, ScopeTypes.EVENT_REGISTRY, eventDefinitionKey);
                if (StringUtils.isNotEmpty(defaultTenant)) {
                    eventDefinitionEntity = eventDefinitionEntityManager.findLatestEventDefinitionByKeyAndTenantId(eventDefinitionKey, defaultTenant);
                } else {
                    eventDefinitionEntity = eventDefinitionEntityManager.findLatestEventDefinitionByKey(eventDefinitionKey);
                }
            }
            
            if (eventDefinitionEntity == null) {
                throw new FlowableObjectNotFoundException("No event definition found for key '" + eventDefinitionKey +
                        " for parent deployment id '" + parentDeploymentId + "' and for tenant identifier " + tenantId, EventDefinitionEntity.class);
            }

        } else {
            throw new FlowableObjectNotFoundException("eventDefinitionKey and eventDefinitionId are null");
        }

        EventDefinitionCacheEntry eventDefinitionCacheEntry = deploymentManager.resolveEventDefinition(eventDefinitionEntity);
        return eventEngineConfiguration.getEventJsonConverter().convertToEventModel(eventDefinitionCacheEntry.getEventDefinitionJson());
    }
}

View on GitHub (pinned to d6d39ce1c6)