Control and management for the flexible manufacturing of pharmaceutical products