A state can contain a history state. The history element applies to the state region that directly contains it. It can have any number of incoming transitions from outside states. At most, it can have one outgoing unlabeled transition.
To create a history element:
Click the History button
on the diagram toolbar.
Click on the diagram to create the element.
To designate deep history for a history element:.
Right click on the history element.
From the context menu, choose Properties.
Set the deep field to "true".