{"record":{"id":"182f68ea97f04ec1","repo":"flowable/flowable-engine","slug":"found-event-definition-of-unknown-type-eventtyp","errorCode":null,"errorMessage":"Found event definition of unknown type: ${eventType}","messagePattern":"Found event definition of unknown type: (.+?)","errorType":"exception","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/EventSubscriptionDeclaration.java","lineNumber":94,"sourceCode":"        return eventType;\r\n    }\r\n\r\n    public String getConfiguration() {\r\n        return configuration;\r\n    }\r\n\r\n    public void setConfiguration(String configuration) {\r\n        this.configuration = configuration;\r\n    }\r\n\r\n    public EventSubscriptionEntity prepareEventSubscriptionEntity(ExecutionEntity execution) {\r\n        EventSubscriptionEntity eventSubscriptionEntity = null;\r\n        if (\"message\".equals(eventType)) {\r\n            eventSubscriptionEntity = new MessageEventSubscriptionEntity(execution);\r\n        } else if (\"signal\".equals(eventType)) {\r\n            eventSubscriptionEntity = new SignalEventSubscriptionEntity(execution);\r\n        } else {\r\n            throw new ActivitiIllegalArgumentException(\"Found event definition of unknown type: \" + eventType);\r\n        }\r\n\r\n        eventSubscriptionEntity.setEventName(eventName);\r\n        if (activityId != null) {\r\n            ActivityImpl activity = execution.getProcessDefinition().findActivity(activityId);\r\n            eventSubscriptionEntity.setActivity(activity);\r\n        }\r\n\r\n        if (configuration != null) {\r\n            eventSubscriptionEntity.setConfiguration(configuration);\r\n        }\r\n\r\n        return eventSubscriptionEntity;\r\n    }\r\n\r\n}\r\n","sourceCodeStart":76,"sourceCodeEnd":111,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/EventSubscriptionDeclaration.java#L76-L111","documentation":"EventSubscriptionDeclaration.prepareEventSubscriptionEntity only knows how to materialize 'message' and 'signal' event subscriptions into EventSubscriptionEntity instances. Any other eventType string (e.g. an 'error' or unknown type) reaches the else branch and throws this ActivitiIllegalArgumentException.","triggerScenarios":"An EventSubscriptionDeclaration was created with an eventType other than 'message' or 'signal' and is then converted to a subscription entity during execution start/notify; typically a bug or misuse when adding custom event types.","commonSituations":"Custom engine extensions introducing new event types without updating this factory; corrupted/incorrectly transformed BPMN where an event definition was mapped to the wrong type string.","solutions":["Ensure event definitions in your BPMN only declare supported types (messageEventDefinition, signalEventDefinition)","If you are extending the engine, add a branch for your event type here and create the appropriate EventSubscriptionEntity","Check the eventType value logged in the exception to trace which declaration produced the bad type"],"exampleFix":"// before\nEventSubscriptionDeclaration d = new EventSubscriptionDeclaration(\"error\", ...);\nEventSubscriptionEntity e = d.prepareEventSubscriptionEntity(execution); // throws\n// after: use supported types\nEventSubscriptionDeclaration d = new EventSubscriptionDeclaration(\"signal\", ...);","handlingStrategy":"type-guard","validationCode":"// check declaration type before converting\nif (!\"message\".equals(eventType) && !\"signal\".equals(eventType)) {\n  throw new IllegalArgumentException(\"Unsupported event type: \" + eventType);\n}","typeGuard":"static boolean isSupportedEventType(String eventType) {\n  return \"message\".equals(eventType) || \"signal\".equals(eventType);\n}","tryCatchPattern":"try {\n  EventSubscriptionEntity entity = declaration.prepareEventSubscriptionEntity(execution);\n} catch (ActivitiIllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Found event definition of unknown type\")) { /* inspect eventType */ }\n}","preventionTips":["Only declare messageEventDefinition/signalEventDefinition in BPMN","If extending event types, extend prepareEventSubscriptionEntity accordingly","Log the eventType at declaration-creation time to trace bad values"],"tags":["bpmn","events","signal","message"],"backgroundTag":"invalid-enum-value","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"}