The Constitution offers no provisions requiring primary elections. In fact, the Constitution doesn't address political parties. Before 1912 the political parties selected their nominees at national conventions, attended by delegates, who were selected at state conventions. The selection of delegates and ultimately nominees was done in smoke filled rooms where party bosses and other leaders made promises and exerted influence.
A western state (I forget which one -Oregon or Washington) was the first to allow for an election to allow for the selection of delegates. The system evolved and each state has their own delegate requirements from "winner take all" to committed and open delegates. The evolution of the primary system maintains the national convention, which largely has become superfluous, and would be only necessary if neither candidate had a majority of delegates.
When I vote in a primary, I always reserve my delegate votes for those, who are committed to the candidate I'm supporting. I could never understand how people could vote for non-committed delegates. I remember the controversy in 1980 when Ted Kennedy trailed Carter in delegates during their primary, and he and others were pushing for an open convention that would have freed up all the delegates, and changed the rules in the middle of the game.
But I agree with pizzaboy that if Obama has a majority (not just a plurality) of the delegates going into the convention, and Clinton leaves the convention as the nominee, there will be hell to pay.