The flow of events and data on the connections between components in an application may have to be controlled at run time based on the application state to optimize performance. For example, a set of components (or a subsystem) may be inactive in a given state and events flowing towards such inactive components can be eliminated. This paper presents a model-driven approach to dynamically control the flow of events on event connections. The proposed model-driven tool chain consists of analysis algorithms which analyze the application to derive metadata for event flow control, and an adaptive event communication framework which provides configurable event communication middleware. The metadata derived by the analysis algorithms is used to automatically configure the middleware for application state-aware propagation of events. The analysis algorithms are specially useful in large scale distributed real-time embedded systems where deriving such metadata manually can be tedious and error-prone. We have applied the proposed mechanisms to application scenarios from the Boeing BoldStroke system.