Add StateMachine.

-- RMonica