{"record":{"id":"719015a094d7f9cf","repo":"flowable/flowable-engine","slug":"could-not-find-event-model-with-key-eventdefini","errorCode":null,"errorMessage":"Could not find event model with key '${eventDefinitionKey}'.","messagePattern":"Could not find event model with key '(.+?)'\\.","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/AbstractCaseStartEventSubscriptionCmd.java","lineNumber":135,"sourceCode":"            .caseDefinitionId(caseDefinitionId)\n            .singleResult();\n\n        if (caseDefinition == null) {\n            throw new FlowableIllegalArgumentException(\"No deployed case definition found for id '\" + caseDefinitionId + \"'.\");\n        }\n        return caseDefinition;\n    }\n\n    protected Case getCase(String caseDefinitionId, CommandContext commandContext) {\n        CmmnRepositoryService repositoryService = CommandContextUtil.getCmmnEngineConfiguration(commandContext).getCmmnRepositoryService();\n        CmmnModel cmmnModel = repositoryService.getCmmnModel(caseDefinitionId);\n        return cmmnModel.getPrimaryCase();\n    }\n\n    protected EventModel getEventModel(String eventDefinitionKey, String tenantId, CommandContext commandContext) {\n        EventModel eventModel = CommandContextUtil.getEventRepositoryService(commandContext).getEventModelByKey(eventDefinitionKey, tenantId);\n        if (eventModel == null) {\n            throw new FlowableIllegalArgumentException(\"Could not find event model with key '\" + eventDefinitionKey + \"'.\");\n        }\n        return eventModel;\n    }\n\n    protected String getStartCorrelationConfiguration(String caseDefinitionId, CommandContext commandContext) {\n        CmmnModel cmmnModel = CommandContextUtil.getCmmnEngineConfiguration(commandContext).getCmmnRepositoryService().getCmmnModel(caseDefinitionId);\n        if (cmmnModel != null) {\n            List<ExtensionElement> correlationCfgExtensions = cmmnModel.getPrimaryCase().getExtensionElements()\n                .getOrDefault(CmmnXmlConstants.START_EVENT_CORRELATION_CONFIGURATION, Collections.emptyList());\n            if (!correlationCfgExtensions.isEmpty()) {\n                return correlationCfgExtensions.get(0).getElementText();\n            }\n        }\n        return null;\n    }\n\n    protected EventSubscriptionService getEventSubscriptionService(CommandContext commandContext) {\n        return CommandContextUtil.getCmmnEngineConfiguration(commandContext).getEventSubscriptionServiceConfiguration().getEventSubscriptionService();","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/AbstractCaseStartEventSubscriptionCmd.java#L117-L153","documentation":"FlowableIllegalArgumentException thrown by getEventModel when the event repository service cannot find an event model for the given eventDefinitionKey (and tenantId). A case start-event subscription requires the referenced event model to be deployed in the event registry.","triggerScenarios":"AbstractCaseStartEventSubscriptionCmd.getEventModel(key, tenantId, ctx) where getEventModelByKey returns null — the event definition key in the case model's start-event mapping has no matching deployed event model.","commonSituations":"Event registry artifacts (.event JSON) not deployed alongside the CMMN model; event key typo in the case diagram's start event; event model deployed under a different tenantId than requested.","solutions":["Deploy the event model (.event resource) containing the referenced key via the event registry repository service.","Fix the eventDefinitionKey in the CMMN model so it matches the deployed event model key.","Verify tenant consistency: query getEventModelByKey with the same tenantId used at deployment."],"exampleFix":"// before (case model references)\n<startEvent id=\"start\" flowable:eventKey=\"orderRecieved\" /> // typo\n// after\n<startEvent id=\"start\" flowable:eventKey=\"orderReceived\" />","handlingStrategy":"validation","validationCode":"EventModel em = eventRepositoryService.getEventModelByKey(eventKey, tenantId);\nif (em == null) throw new IllegalStateException(\"deploy event model for key \" + eventKey);","typeGuard":null,"tryCatchPattern":"try { subscribe(caseKey, eventKey); }\ncatch (FlowableIllegalArgumentException e) { if (e.getMessage().contains(\"Could not find event model\")) { deployEventResources(); throw e; } }","preventionTips":["Package .event resources together with the CMMN model in the same deployment","Validate event keys referenced in case diagrams at build time against the event registry"],"tags":["cmmn","event-registry","event-model"],"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-14T11:17:12.474Z"}