Statecharts define the run-time behavior of instances of a class. A state in a statechart is an abstraction of the mode in which the object finds itself. A message triggers a transition from one state to another. A message can be either an event or a triggered operation. An object can receive both kinds of messages when sent from other objects. An object can always receive events it sends to itself (self-messages). In Rational Rhapsody, statecharts are part of the object-oriented paradigm. The more complicated classes can have statecharts; simpler classes do not require them.
You can use operations and attributes in classes with statecharts to define guards and actions, as in the following example.
