Attributes/operations are part of the transitions. You can check attributes as part of a Guard which limits transition between states. On Entry/Exit (and inside) of a state you can perform operations of the class.
Edit based on your comment:
Suppose I have a class called Teacher
with two functions named getteachername()
and setteachername()
with one attribute named name
.
You would use a state chart (in the following very trivial and silly case) if you need to implement constraints. Say that the name can only be set on a rule that allows to append a string to it if it starts with "Paul". Then you start with the state isEmpty
. It has an outgoing transition modify
where it goes to statePaul
if the name is set to "Paul". From that state you can transit to the same state when appending something to name
. From the stateOther
you can only transit to the isEmpty
.
Note that this is constructed, silly and non-realistic. But it shows how a state machine controls changes of attributes based on using methods of a class.