When should a company build, buy or partner? Here's what you need to know.