Freitag, 8. März 2013

Statechart Refactorings

In the upcoming version 2.1.0 of the open source toolkit Yakindu Statechart Tools we added a set of statechart refactorings:
  • Rename Element
  • Extract- / Inline Subdiagram
  • Fold Incoming / Outgoing Actions
  • Unfold Entry / Exit Actions
  • Group States Into Composite State 

Rename Element

The 'Rename Element' refactoring renames Variables, Events and Interfaces in the whole statechart model. The 'Refactoring' context menu is available in the in-diagram editor as well as in property sheets.

Extract- / Inline Subdiagram

When using Composite States, the statechart model often becomes too big to get a complete overview of the whole diagram. Although it is possible to collapse and expand a state's figure compartment, these actions spoil the diagram layout each time they are executed. Therefore, we introduced so-called Subdiagrams.


If the 'Extract Subdiagram' refactoring is executed on a Composite State, all containing Regions are extracted into a separate diagram. A small decorator in the lower right corner of the State indicates the existence of such a subdiagram. If you hover with the mouse cursor over the decorator, you get a small preview image of the subdiagrams content. The refactoring also creates required Entry and Exit Points for you.


With a click on the decorator, the subdiagram opens in a separate editor tab. The breadcrumb on the top allows easy navigation throughout the different hierachy levels.

 

Fold Incoming/Outgoing Actions and Unfold Entry/Exit Actions

These two refactorings move actions of incoming or outgoing transitions to the entry or exit block of a state and vice versa. They are applicable to all states where transitions have a common subset of actions.

Group States Into Composite State

This refactoring puts a set of selected states into a composite state. It is applicable to all states that are contained within the same region. 

Thanks to Thomas who did a large part of this contribution, keep up the good work ;-)