flowable/flowable-engine · error · FlowableObjectNotFoundException
No case definition found for key '${caseDefinitionKey}'
Error message
No case definition found for key '${caseDefinitionKey}' What it means
FlowableObjectNotFoundException thrown by getLatestCaseDefinitionByKey when no case definition with the given key exists (querying without tenantId, or with NO_TENANT_ID). The command resolving the latest case definition for a start-event subscription cannot find any deployed definition for that key.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/AbstractCaseStartEventSubscriptionCmd.java:76
protected void checkEventModelCorrelationParameter(EventModel eventModel, String correlationParameterName) {
Collection<EventPayload> correlationParameters = eventModel.getCorrelationParameters();
for (EventPayload correlationParameter : correlationParameters) {
if (correlationParameter.getName().equals(correlationParameterName)) {
return;
}
}
throw new FlowableIllegalArgumentException("There is no correlation parameter with name '" + correlationParameterName + "' defined in event model "
+ "with key '" + eventModel.getKey() + "'. You can only subscribe for an event with a combination of valid correlation parameters.");
}
protected CaseDefinition getLatestCaseDefinitionByKey(String caseDefinitionKey, String tenantId, CommandContext commandContext) {
CaseDefinitionEntityManager caseDefinitionEntityManager = CommandContextUtil.getCaseDefinitionEntityManager(commandContext);
CaseDefinition caseDefinition = null;
if (caseDefinitionKey != null && (tenantId == null || CmmnEngineConfiguration.NO_TENANT_ID.equals(tenantId))) {
caseDefinition = caseDefinitionEntityManager.findLatestCaseDefinitionByKey(caseDefinitionKey);
if (caseDefinition == null) {
throw new FlowableObjectNotFoundException("No case definition found for key '" + caseDefinitionKey + "'", CaseDefinition.class);
}
} else if (caseDefinitionKey != null && tenantId != null && !CmmnEngineConfiguration.NO_TENANT_ID.equals(tenantId)) {
caseDefinition = caseDefinitionEntityManager.findLatestCaseDefinitionByKeyAndTenantId(caseDefinitionKey, tenantId);
if (caseDefinition == null) {
CmmnEngineConfiguration caseEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);
if (caseEngineConfiguration.isFallbackToDefaultTenant()) {
String defaultTenant = caseEngineConfiguration.getDefaultTenantProvider().getDefaultTenant(tenantId, ScopeTypes.BPMN, caseDefinitionKey);
if (StringUtils.isNotEmpty(defaultTenant)) {
caseDefinition = caseDefinitionEntityManager.findLatestCaseDefinitionByKeyAndTenantId(caseDefinitionKey, defaultTenant);
} else {
caseDefinition = caseDefinitionEntityManager.findLatestCaseDefinitionByKey(caseDefinitionKey);
}
if (caseDefinition == null) {View on GitHub (pinned to d6d39ce1c6)
Solutions
- Verify the case definition key via the repository service case definition query and correct the key used.
- Deploy the CMMN model containing the case definition before creating the subscription.
- Check tenant handling: if multi-tenant, pass the correct tenantId so the tenant-aware lookup path is used.
Example fix
// before
runtimeService.createCaseInstanceBuilder().caseDefinitionKey("orderCase").start(); // key is actually 'order-case'
// after
runtimeService.createCaseInstanceBuilder().caseDefinitionKey("order-case").start(); Defensive patterns
Strategy: validation
Validate before calling
boolean exists = cmmnRepositoryService.createCaseDefinitionQuery()
.caseDefinitionKey(key).count() > 0;
if (!exists) throw new IllegalStateException("deploy case definition " + key + " first"); Try / catch
try { builder.caseDefinitionKey(key).start(); }
catch (FlowableObjectNotFoundException e) { if (e.getObjectClass() == CaseDefinition.class) { deployIfMissing(key); } } Prevention
- Deploy CMMN models in application startup before creating subscriptions or starting cases
- Centralize case definition keys as constants shared with the model files
When it happens
Trigger: getLatestCaseDefinitionByKey(caseDefinitionKey, null|NO_TENANT_ID, ctx) when caseDefinitionEntityManager.findLatestCaseDefinitionByKey(key) returns null — i.e., the case definition was never deployed or its key differs.
Common situations: Typo in the case definition key referenced in the CMMN plan model or client code; deployment never happened or was deleted; case definition deployed under a different key than the event registry start-event mapping expects.
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 deployed case definition found for key '${caseDefinitionK
- No case definition found for key <caseDefinitionKey>
- DMN decision with key ${externalRef} was not executed. For $
- No event model found for event key ${key} for ${planItemInst
- No case definition found for key '${caseDefinitionKey}'. Fal
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/068ebb41d3211d5f.
Report an issue: GitHub.