Statechart inheritance
Statechart inheritance begins when a class derives from a superclass that has a
statechart. The statechart of the subclass, the inherited statechart, is initially a clone of the
superclass.
Except for the following items, you can add things to an
inherited statechart to override behavior in the inherited class.
You cannot make the following changes to items in the statechart of a subclass:
- Change the source of a transition.
- Change the triggers (events or triggered operations).
- Delete or rename a state.
- Draw a state around an existing state.
You can make the following changes to items in the statechart of a subclass:
- Change anything that does not affect the model, such as moving things in the diagram without actually editing.
- Add objects to a state.
- Add more states, but not re-parent states.
- Attach a transition to a different target.
An inherited statechart consists of all the items inherited from the superclass, as well as modified and added elements.
Note: It is possible to inherit statecharts across
packages.
If you edit a base statechart, the derived statechart is redrawn only on demand at checks, code generation, report generation, or the opening of a derived statechart.