flowable/flowable-engine · error · FlowableIllegalArgumentException

No deployed case definition found for id '${caseDefinitionId

Error message

No deployed case definition found for id '${caseDefinitionId}'.

What it means

Guard in AbstractCaseStartEventSubscriptionCmd.getCaseDefinitionById: the case definition looked up by the supplied id does not exist (or is not deployed), so the event subscription cannot be tied to a case definition.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/AbstractCaseStartEventSubscriptionCmd.java:121

            }
        }
        
        if (caseDefinition == null) {
            throw new FlowableIllegalArgumentException("No deployed case definition found for key '" + caseDefinitionKey + "'.");
        }
        
        return caseDefinition;
    }

    protected CaseDefinition getCaseDefinitionById(String caseDefinitionId, CommandContext commandContext) {
        CmmnRepositoryService repositoryService = CommandContextUtil.getCmmnEngineConfiguration(commandContext).getCmmnRepositoryService();

        CaseDefinition caseDefinition = repositoryService.createCaseDefinitionQuery()
            .caseDefinitionId(caseDefinitionId)
            .singleResult();

        if (caseDefinition == null) {
            throw new FlowableIllegalArgumentException("No deployed case definition found for id '" + caseDefinitionId + "'.");
        }
        return caseDefinition;
    }

    protected Case getCase(String caseDefinitionId, CommandContext commandContext) {
        CmmnRepositoryService repositoryService = CommandContextUtil.getCmmnEngineConfiguration(commandContext).getCmmnRepositoryService();
        CmmnModel cmmnModel = repositoryService.getCmmnModel(caseDefinitionId);
        return cmmnModel.getPrimaryCase();
    }

    protected EventModel getEventModel(String eventDefinitionKey, String tenantId, CommandContext commandContext) {
        EventModel eventModel = CommandContextUtil.getEventRepositoryService(commandContext).getEventModelByKey(eventDefinitionKey, tenantId);
        if (eventModel == null) {
            throw new FlowableIllegalArgumentException("Could not find event model with key '" + eventDefinitionKey + "'.");
        }
        return eventModel;
    }

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Fetch the current id via createCaseDefinitionQuery().caseDefinitionKey(key).latestVersion() instead of hard-coding ids.
  2. Verify the id belongs to the CMMN (not BPMN) repository and to the same database/environment.
  3. Re-resolve the definition after redeployment; definition ids change per deployment.

Example fix

// before
caseInstanceBuilder.caseDefinitionId("ORD-1"); // stale id
// after
caseInstanceBuilder.caseDefinitionKey("order-case").start(); // resolve latest by key
Defensive patterns

Strategy: validation

Validate before calling

CaseDefinition cd = cmmnRepositoryService.createCaseDefinitionQuery()
    .caseDefinitionId(id).singleResult();
if (cd == null) throw new IllegalStateException("unknown case definition id " + id);

Try / catch

try { builder.caseDefinitionId(id).start(); }
catch (FlowableIllegalArgumentException e) { if (e.getMessage().contains("No deployed case definition found for id")) { resolveByKeyInstead(); } }

Prevention

When it happens

Trigger: getCaseDefinitionById(caseDefinitionId, ctx) where repositoryService.createCaseDefinitionQuery().caseDefinitionId(id).singleResult() is null — stale or fabricated id.

Common situations: Using an id from another engine/database (e.g., process definition id in a CMMN call); id stored/cached from a redeployment that replaced the definition; hard-coded id from a different environment.

Related errors


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