Order Regulations

When a railroad (here in the US or Export) places an order for locomotives…do they have to sign a contract or special regulations with leasers, or banks etc. to own the locomotives? What happens if they are canceled? And how about orders that are tacked on to others?