-
Notifications
You must be signed in to change notification settings - Fork 86
Why is a composite state required to have a default initial pseudostate? #3206
Description
In section 14.2.3.2 in the UML Specification under Region reads
"Default activation means that execution starts with the Transition originating from the initial Pseudostate of the Region,
if one is defined. However, no specific approach is defined if there is no initial Pseudostate that exists within the
Region. One possible approach is to deem the model ill defined. An alternative is that the Region remains inactive,
although the State that contains it is active. In other words, the containing composite State is treated as a simple (leaf)
State."
I am wondering why you chose the Ill defined form of the recommendation?
In my particular use case a multi-stage furnace when the controller turns on it enters Stage 1 after a period of time and some conditions are met it may need to enter Stage 2. Stage 2 can't be active unless Stage 1 is active. Therefor to appropriately model this behavior Stage 2 should be nested in Stage 1. Stage 3 would be nested in Stage 2 and so on. Because when the controller shuts off it must exit and disable each stage in order. I could circumvent this by adding an On / Off to each composite stage with an initial transition into the Off state. I could also use submachine states for each Stage but the latter two approaches require more work and having an enabled State with a region that is inactive seems less verbose. I understand if you don't agree I am just curious as to your thoughts on allowing that approach?