{"record":{"id":"463f75ffb0cbc01f","repo":"flowable/flowable-engine","slug":"cannot-have-more-than-one-message-event-subscripti","errorCode":null,"errorMessage":"Cannot have more than one message event subscription with name '{}' for scope '{}'","messagePattern":"Cannot have more than one message event subscription with name '(.+?)' for scope '(.+?)'","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/AbstractBpmnParseHandler.java","lineNumber":151,"sourceCode":"        }\n        return executionListener;\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    protected void addEventSubscriptionDeclaration(BpmnParse bpmnParse, EventSubscriptionDeclaration subscription, EventDefinition parsedEventDefinition, ScopeImpl scope) {\n        List<EventSubscriptionDeclaration> eventDefinitions = (List<EventSubscriptionDeclaration>) scope.getProperty(PROPERTYNAME_EVENT_SUBSCRIPTION_DECLARATION);\n        if (eventDefinitions == null) {\n            eventDefinitions = new ArrayList<>();\n            scope.setProperty(PROPERTYNAME_EVENT_SUBSCRIPTION_DECLARATION, eventDefinitions);\n        } else {\n            // if this is a message event, validate that it is the only one with the provided name for this scope\n            if (\"message\".equals(subscription.getEventType())) {\n                for (EventSubscriptionDeclaration eventDefinition : eventDefinitions) {\n                    if (\"message\".equals(eventDefinition.getEventType())\n                            && eventDefinition.getEventName().equals(subscription.getEventName())\n                            && eventDefinition.isStartEvent() == subscription.isStartEvent()) {\n\n                        LOGGER.warn(\"Cannot have more than one message event subscription with name '{}' for scope '{}'\", subscription.getEventName(), scope.getId());\n                    }\n                }\n            }\n        }\n        eventDefinitions.add(subscription);\n    }\n\n    protected String getPrecedingEventBasedGateway(BpmnParse bpmnParse, IntermediateCatchEvent event) {\n        String eventBasedGatewayId = null;\n        for (SequenceFlow sequenceFlow : event.getIncomingFlows()) {\n            FlowElement sourceElement = bpmnParse.getBpmnModel().getFlowElement(sequenceFlow.getSourceRef());\n            if (sourceElement instanceof EventGateway) {\n                eventBasedGatewayId = sourceElement.getId();\n                break;\n            }\n        }\n        return eventBasedGatewayId;\n    }","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/AbstractBpmnParseHandler.java#L133-L169","documentation":"addEventSubscriptionDeclaration() warns when a scope already contains a message event subscription with the same event name and start-event flag. The duplicate subscription is still added, but only one can be triggered deterministically, signaling a modeling mistake.","triggerScenarios":"Two message start events (or two message boundary/intermediate catch events) in the same scope declare the same message name — e.g. duplicate <messageEventDefinition messageRef=\"x\"/> — detected in AbstractBpmnParseHandler.addEventSubscriptionDeclaration().","commonSituations":"Copy-pasted message start events in a process (or two executable processes sharing a message name in the same deployment scope); merging process models without renaming message refs.","solutions":["Give each message event subscription a unique message name within its scope","Remove the duplicate message event declaration","If separate processes need the same message, place them in scopes where the subscription names do not collide, or correlate deliberately with distinct names"],"exampleFix":"// before\n<messageEventDefinition messageRef=\"orderReceived\"/> (twice in same scope)\n// after\n<messageEventDefinition messageRef=\"orderReceived\"/>\n<messageEventDefinition messageRef=\"orderAmended\"/>","handlingStrategy":"validation","validationCode":"// Detect duplicate message names per scope before deployment\nMap<String,Integer> counts = new HashMap<>();\nfor (MessageEventDefinition def : collectMessageDefinitions(process)) {\n    counts.merge(def.getMessageRef(), 1, Integer::sum);\n}\ncounts.forEach((name,c) -> { if (c > 1) throw new IllegalArgumentException(\"Duplicate message name: \" + name); });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep message names unique within each scope/process","Review merged process models for duplicated message start events"],"tags":["bpmn","events","message"],"backgroundTag":"conflicting-config-options","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"}