{"record":{"id":"9bd82402e4f6e758","repo":"flowable/flowable-engine","slug":"no-case-definition-deployed-with-key-casedefinit","errorCode":null,"errorMessage":"no case definition deployed with key '<caseDefinitionKey>'","messagePattern":"no case definition deployed with key '<caseDefinitionKey>'","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/deployer/CmmnDeploymentManager.java","lineNumber":80,"sourceCode":"\n        CaseDefinitionCacheEntry cacheEntry = caseDefinitionCache.get(caseDefinitionId);\n        CaseDefinition caseDefinition = cacheEntry != null ? cacheEntry.getCaseDefinition() : null;\n\n        if (caseDefinition == null) {\n            caseDefinition = caseDefinitionEntityManager.findById(caseDefinitionId);\n            if (caseDefinition == null) {\n                throw new FlowableObjectNotFoundException(\"no deployed case definition found with id '\" + caseDefinitionId + \"'\", CaseDefinition.class);\n            }\n            caseDefinition = resolveCaseDefinition(caseDefinition).getCaseDefinition();\n        }\n        return caseDefinition;\n    }\n\n    public CaseDefinition findDeployedLatestCaseDefinitionByKey(String caseDefinitionKey) {\n        CaseDefinition caseDefinition = caseDefinitionEntityManager.findLatestCaseDefinitionByKey(caseDefinitionKey);\n\n        if (caseDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"no case definition deployed with key '\" + caseDefinitionKey + \"'\", CaseDefinition.class);\n        }\n        caseDefinition = resolveCaseDefinition(caseDefinition).getCaseDefinition();\n        return caseDefinition;\n    }\n\n    public CaseDefinition findDeployedLatestCaseDefinitionByKeyAndTenantId(String caseDefinitionKey, String tenantId) {\n        CaseDefinition caseDefinition = caseDefinitionEntityManager.findLatestCaseDefinitionByKeyAndTenantId(caseDefinitionKey, tenantId);\n        if (caseDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"no case definition deployed with key '\" + caseDefinitionKey + \"' for tenant identifier '\" + tenantId + \"'\", CaseDefinition.class);\n        }\n        caseDefinition = resolveCaseDefinition(caseDefinition).getCaseDefinition();\n        return caseDefinition;\n    }\n\n    public CaseDefinition findDeployedCaseDefinitionByKeyAndVersionAndTenantId(String caseDefinitionKey, Integer caseDefinitionVersion, String tenantId) {\n        CaseDefinition caseDefinition = (CaseDefinitionEntity) caseDefinitionEntityManager\n                .findCaseDefinitionByKeyAndVersionAndTenantId(caseDefinitionKey, caseDefinitionVersion, tenantId);\n        if (caseDefinition == null) {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/deployer/CmmnDeploymentManager.java#L62-L98","documentation":"findDeployedLatestCaseDefinitionByKey queries the persistence layer for the case definition with the highest version for the given key. When no definition with that key is deployed at all, it throws FlowableObjectNotFoundException. Callers like resolveCaseDefinition rely on a non-null result to populate the cache.","triggerScenarios":"Calling APIs that resolve by key (e.g. starting a case instance by caseDefinitionKey) with a key that has no deployed case definition — typo in the key, or the model was never deployed to this engine/database.","commonSituations":"Deploying to a test environment but running the app against production DB; renaming the <case id> in the CMMN XML while code still uses the old key; forgetting to deploy the .cmmn resource entirely.","solutions":["Check deployed keys via cmmnRepositoryService.createCaseDefinitionQuery().list() and correct the key","Deploy the CMMN model containing the case (RepositoryService.createDeployment().addClasspathResource(...).deploy())","Verify the engine points at the database/environment where the case definition is deployed"],"exampleFix":"// before\ncmmnRuntimeService.createCaseInstanceBuilder().caseDefinitionKey(\"creditChck\").start();\n// after (key matches deployed <case id=\"creditCheck\">)\ncmmnRuntimeService.createCaseInstanceBuilder().caseDefinitionKey(\"creditCheck\").start();","handlingStrategy":"validation","validationCode":"CaseDefinition def = repositoryService.createCaseDefinitionQuery().caseDefinitionKey(key).latestVersion().singleResult(); if (def == null) { /* not deployed */ }","typeGuard":null,"tryCatchPattern":"try { builder.caseDefinitionKey(key).start(); } catch (FlowableObjectNotFoundException e) { log.error(\"Case '{}' not deployed\", key, e); }","preventionTips":["Deploy CMMN resources as part of application startup","Keep case keys in constants/shared config rather than inline strings"],"tags":["not-found","case-definition","deployment-key"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}