{"record":{"id":"cade397d62538fe4","repo":"flowable/flowable-engine","slug":"could-not-find-a-case-definition-with-id-casede","errorCode":null,"errorMessage":"Could not find a case definition with id '${caseDefinitionId}'.","messagePattern":"Could not find a case definition with id '(.+?)'\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/BaseCaseDefinitionResource.java","lineNumber":59,"sourceCode":"    protected CaseDefinition getCaseDefinitionFromRequest(String caseDefinitionId) {\n        CaseDefinition caseDefinition = getCaseDefinitionFromRequestWithoutAccessCheck(caseDefinitionId);\n\n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessCaseDefinitionById(caseDefinition);\n        }\n\n        return caseDefinition;\n    }\n\n    /**\n     * Returns the {@link CaseDefinition} that is requested without calling the access interceptor\n     * Throws the right exceptions when bad request was made or definition was not found.\n     */\n    protected CaseDefinition getCaseDefinitionFromRequestWithoutAccessCheck(String caseDefinitionId) {\n        CaseDefinition caseDefinition = repositoryService.getCaseDefinition(caseDefinitionId);\n\n        if (caseDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a case definition with id '\" + caseDefinitionId + \"'.\", CaseDefinition.class);\n        }\n        \n        return caseDefinition;\n    }\n}\n","sourceCodeStart":41,"sourceCodeEnd":65,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/BaseCaseDefinitionResource.java#L41-L65","documentation":"BaseCaseDefinitionResource.getCaseDefinitionFromRequestWithoutAccessCheck looks up a case definition by id via repositoryService.getCaseDefinition. When no case definition exists for the given id, it throws FlowableObjectNotFoundException carrying CaseDefinition.class so REST mappings translate it to a 404.","triggerScenarios":"Any REST call resolving a case definition path variable, e.g. GET /cmmn-repository/case-definitions/{caseDefinitionId} or POST .../case-definitions/{id}/identity-links, where the id does not match a deployed case definition.","commonSituations":"Typos in the definition id; referencing a definition that was deleted by a redeploy/cleanup; using a case definition key instead of id; querying a different tenant/database than where it was deployed.","solutions":["Verify the id by listing definitions: GET /cmmn-repository/case-definitions and copy the exact 'id'.","Check you are not confusing the definition 'key' with the 'id'; the endpoint requires the id.","Confirm the CMMN deployment still exists and was not removed (check /cmmn-repository/deployments).","Ensure the REST service connects to the same database/tenant where the definition is deployed."],"exampleFix":"// before\nGET /cmmn-repository/case-definitions/myCase  // key, not id\n// after\nGET /cmmn-repository/case-definitions        // find exact id\nGET /cmmn-repository/case-definitions/caseOrderProcess:1:104","handlingStrategy":"try-catch","validationCode":"const defs = await get('/cmmn-repository/case-definitions');\nconst exists = defs.data.some(d => d.id === caseDefinitionId);\nif (!exists) throw new Error(`Unknown case definition id: ${caseDefinitionId}`);","typeGuard":null,"tryCatchPattern":"try {\n  const def = await getCaseDefinition(id);\n} catch (e) {\n  if (e.response?.status === 404 && /case definition/.test(e.response.data?.message)) {\n    // refresh id from /case-definitions list and retry once\n  } else throw e;\n}","preventionTips":["Always resolve ids from the list endpoint instead of hard-coding them.","Remember REST endpoints take definition id, not key.","Re-fetch ids after any redeploy or cascade delete."],"tags":["rest-api","not-found","case-definition"],"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"}