Revert a Composite State Back to a Basic State When Using StaMa Visio Shapes |
Explains how to convert the visual representation of a composite state back to a simple state.
During refactoring a state machine it might happen that a composite state shall be reverted to a simple state. If multiple transitions end at the state or the state contains a complex sub-region, it may sometimes be desirable to deconstruct the composite state.
The main point for deconstructing is that there is no easy way to remove an entire region or multi-selection of shapes from a composite state. In case the states within the sub-region are to be reused, the easiest way is to drag the individual states from the sub-region to another region and then delete the obsolete empty sub-region. Semantically and for code generation purposes the empty composite state will work like a simple state, however the visual representation is inappropriate as it still looks like a composite state.
The following procedures show how to appropriately disassemble a composite state as shown in Figure 1.
Select the first state of the sub-region and drag it outside the sub-region.
Drop the state over an unused area.
Repeat the above steps for all other states of the sub-region.
Select the sub-region group container by clicking onto the region order rectangle.
Delete the sub-region group container.
Reduce the size of the composite state below the size of the state name label and execute Convert to Simple State from the context menu of the state shape.