In the context of Industry 4.0, flexible manufacturing systems play an important role. They are designed to provide the possibility to adapt the production process by reacting to changes and enabling customer specific products. The versatility of such manufacturing systems, however, also needs to be exploited by advanced control strategies. To this end, we present a novel scheduling scheme that is able to flexibly react to changes in the manufacturing system by means of Model Predictive Control (MPC). To introduce flexibility from the start, the initial scheduling problem, which is very general and covers a variety of special cases, is formulated in a modular way. This modularity is then preserved during an automatic transformation into a Petri Net formulation, which constitutes the basis for the two presented MPC schemes. We prove that both schemes are guaranteed to complete the production problem in closed loop when reasonable assumptions are fulfilled. The advantages of the presented control framework for flexible manufacturing systems are that it covers a wide variety of scheduling problems, that it is able to exploit the available flexibility of the manufacturing system, and that it allows to prove the completion of the production problem.