feat(message): add cross-module event integration (Phase 6)

- Message module subscribes to workflow events (process_instance.started)
- Auto-generates notifications when workflows start
- Added started_by to workflow instance event payload
- Event listener runs as background tokio task

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-04-11 12:28:13 +08:00
parent 5ceed71e62
commit c0523e19b4
3 changed files with 88 additions and 4 deletions

View File

@@ -124,6 +124,10 @@ async fn main() -> anyhow::Result<()> {
// Register event handlers
registry.register_handlers(&event_bus);
// Start message event listener (workflow events → message notifications)
erp_message::MessageModule::start_event_listener(db.clone(), event_bus.clone());
tracing::info!("Message event listener started");
let host = config.server.host.clone();
let port = config.server.port;