Refactor your statechart models

YAKINDU Statechart Tools has a lot of useful features. In this series we present the "feature of the month" that will help you domesticating your maybe exceeding statechart models.

You may know the renaming refactoring feature of eclipse. This is also possible for statecharts. Select a variable, interface or event and do a right mouseclick. The dialog "Rename" appears.

More complex are the model refactorings like folding and unfolding actions, extract subdiagram or group states into composite. Our documentation explains these features in detail.

I will concentrate on the refactorings to fold actions. You can use them to simplify your transitions. During the development of a statemachine you add states, transitions, actions etc. to your model and it grows and grows. If there are multiple transitions leading to one state that have one action in common it is semantically the same if you move it as an entry action to the target state. Then you select your target state and select 'Refactor' – 'Fold Incoming Actions'.

Fold multiple transistions in a statechart model

You can do the same with multiple transitions that leave a state and have some actions in common. The difference is that these are outgoing actions that will be refactored to exit actions of the source state. By doing this you reduce redundancies and increase the readability of your model.

You want to learn more about refactorings? Then check our statecharts-blog!

Learn more about  refactoring your state machine

About The Author

Svenja Wendler is IT consultant for itemis AG in Lünen. She is working in model based software development, validation and project organization.