In version 2.0, IBM ILOG CP Optimizer has been extended by the introduction of scheduling support based on the concept of optional interval variables. This paper formally describes the new modeling language features available to the users of CP Optimizer for resource-based scheduling. We show that the new language is flexible enough to model problems never before addressed by CP scheduling engines, as well as naturally describing classical scheduling problems found in the literature. This modeling power is based on a small number of general concepts such as intervals, sequences and functions. This makes the modeling language simple, clear and easy to learn, while maintaining the high-level structural aspects of the scheduling model.