{"record":{"id":"e8baa8ce84134925","repo":"flowable/flowable-engine","slug":"message-dispatcher-is-disabled-cannot-dispatch-ev","errorCode":null,"errorMessage":"Message dispatcher is disabled, cannot dispatch event.","messagePattern":"Message dispatcher is disabled, cannot dispatch event\\.","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DispatchEventCommand.java","lineNumber":48,"sourceCode":"\n    protected FlowableEvent event;\n\n    public DispatchEventCommand(FlowableEvent event) {\n        this.event = event;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        if (event == null) {\n            throw new FlowableIllegalArgumentException(\"The event to be dispatched must not be null.\");\n        }\n\n        CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);\n        FlowableEventDispatcher eventDispatcher = cmmnEngineConfiguration.getEventDispatcher();\n        if (eventDispatcher != null && eventDispatcher.isEnabled()) {\n            eventDispatcher.dispatchEvent(event, cmmnEngineConfiguration.getEngineCfgKey());\n        } else {\n            throw new FlowableException(\"Message dispatcher is disabled, cannot dispatch event.\");\n        }\n\n        return null;\n    }\n}\n","sourceCodeStart":30,"sourceCodeEnd":54,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DispatchEventCommand.java#L30-L54","documentation":"FlowableException thrown by DispatchEventCommand.execute when the configured FlowableEventDispatcher is null or disabled, so the event cannot be delivered. This is a feature/configuration gate, not an argument problem: the engine was set up without an enabled event dispatcher.","triggerScenarios":"Calling dispatchEvent on a CmmnEngineConfiguration where the event dispatcher was never registered or where eventDispatcher.setEnabled(false) was set in the configuration.","commonSituations":"Embedding the CMMN engine without the spring/process event infrastructure; deliberately disabling events in tests and leaving dispatch calls in place; a config profile that omits the event dispatcher bean.","solutions":["Enable the event dispatcher in the CmmnEngineConfiguration (eventDispatcher.setEnabled(true) / register a FlowableEventDispatcher)","Check eventDispatcher != null && isEnabled() before dispatching","Remove or guard dispatch calls in configurations where events are intentionally off"],"exampleFix":"// before\ncmmnEngineConfiguration.getEventDispatcher().dispatchEvent(event, key);\n// after\nFlowableEventDispatcher d = cmmnEngineConfiguration.getEventDispatcher();\nif (d != null && d.isEnabled()) {\n    d.dispatchEvent(event, key);\n}","handlingStrategy":"validation","validationCode":"FlowableEventDispatcher d = cfg.getEventDispatcher(); if (d == null || !d.isEnabled()) throw new IllegalStateException(\"event dispatcher disabled\");","typeGuard":"boolean dispatcherReady = cfg.getEventDispatcher() != null && cfg.getEventDispatcher().isEnabled();","tryCatchPattern":"try { dispatcher.dispatchEvent(event, key); } catch (FlowableException e) { log.error(\"event dispatcher disabled in this configuration\", e); }","preventionTips":["Enable the event dispatcher in every engine configuration that dispatches events","Align test and production configs so events are not silently disabled"],"tags":["cmmn","event-dispatch","configuration","feature-disabled"],"backgroundTag":"feature-not-enabled","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"}