flowable/flowable-engine · error · FlowableObjectNotFoundException

no deployed case definition found with id '<caseDefinitionId

Error message

no deployed case definition found with id '<caseDefinitionId>'

What it means

findDeployedCaseDefinitionById looked up the cache and the case definition table but found no case definition for the given id, so it throws FlowableObjectNotFoundException with CaseDefinition.class. The id is well-formed; it simply does not refer to any deployed case definition.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/deployer/CmmnDeploymentManager.java:69

    public void deploy(EngineDeployment deployment, Map<String, Object> deploymentSettings) {
        for (EngineDeployer deployer : deployers) {
            deployer.deploy(deployment, deploymentSettings);
        }
    }

    public CaseDefinition findDeployedCaseDefinitionById(String caseDefinitionId) {
        if (caseDefinitionId == null) {
            throw new FlowableIllegalArgumentException("Invalid case definition id : null");
        }

        CaseDefinitionCacheEntry cacheEntry = caseDefinitionCache.get(caseDefinitionId);
        CaseDefinition caseDefinition = cacheEntry != null ? cacheEntry.getCaseDefinition() : null;

        if (caseDefinition == null) {
            caseDefinition = caseDefinitionEntityManager.findById(caseDefinitionId);
            if (caseDefinition == null) {
                throw new FlowableObjectNotFoundException("no deployed case definition found with id '" + caseDefinitionId + "'", CaseDefinition.class);
            }
            caseDefinition = resolveCaseDefinition(caseDefinition).getCaseDefinition();
        }
        return caseDefinition;
    }

    public CaseDefinition findDeployedLatestCaseDefinitionByKey(String caseDefinitionKey) {
        CaseDefinition caseDefinition = caseDefinitionEntityManager.findLatestCaseDefinitionByKey(caseDefinitionKey);

        if (caseDefinition == null) {
            throw new FlowableObjectNotFoundException("no case definition deployed with key '" + caseDefinitionKey + "'", CaseDefinition.class);
        }
        caseDefinition = resolveCaseDefinition(caseDefinition).getCaseDefinition();
        return caseDefinition;
    }

    public CaseDefinition findDeployedLatestCaseDefinitionByKeyAndTenantId(String caseDefinitionKey, String tenantId) {
        CaseDefinition caseDefinition = caseDefinitionEntityManager.findLatestCaseDefinitionByKeyAndTenantId(caseDefinitionKey, tenantId);

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify the id exists by querying CmmnRepositoryService.createCaseDefinitionQuery() and listing deployed definitions
  2. Deploy the case model that the id refers to, or point the app at the database containing it
  3. Fix the source of the id — it may be a process definition id used where a case definition id is expected

Example fix

// before
String id = "myCase:1:123"; // stale hard-coded id
CaseDefinition def = cmmnRepositoryService.getCaseDefinition(id);
// after
CaseDefinition def = cmmnRepositoryService.createCaseDefinitionQuery()
        .caseDefinitionKey("myCase").latestVersion().singleResult();
Defensive patterns

Strategy: try-catch

Validate before calling

CaseDefinition def = repositoryService.createCaseDefinitionQuery().caseDefinitionId(id).singleResult(); // null means not deployed

Try / catch

try { def = cmmnRuntimeService.getCaseDefinition(id); } catch (FlowableObjectNotFoundException e) { def = null; /* handle missing definition */ }

Prevention

When it happens

Trigger: Passing a case definition id that was never deployed, an id from a different engine (process vs case), or an id from a database whose ACT_CMMN_CASEDEF table no longer holds it (dropped/cleaned DB, wrong schema).

Common situations: Hard-coded ids after redeploying with a different database; pointing a test at an empty in-memory H2 DB; cross-engine confusion between processDefinitionId and caseDefinitionId.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — 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/42466fac79b0c036. Report an issue: GitHub.