Managing flexibility in the supply chain