An important requirement of pervasive applications is that of data collection, aggregation and dissemination. Event communication middleware based on the publish/subscribe paradigm has been used extensively to address these data flow requirements. In addition to the data flow, the designer of a system may also want to regulate the actions performed by the components in order to implement some constraints and policies. For example, the designer may want to ensure that actions performed a set of components on receiving an event notification are triggered in a specific sequence. In this paper, we propose a framework to implement such constraints by regulating the flow of events in the middleware. Since components perform actions on receiving events, by controlling the notifications delivered to the components and the sequence in which they are delivered, the order in which actions are performed in the application can be controlled. We have implemented the framework in the context of two event services, one in C++ and another in Java. We give several examples demonstrating the use of the proposed approach.