HSM and nesting states

Feb 28, 2011 at 7:36 AM


we are planning to use the state machine CTP in one of our solutions, and I need to use either nested states or hierarchical state machines. I am currently lost on which one is currently supported, and which one to use that would be in alignment with the future planned enhancements. Does the current version support HSM?

Thank you! 

Mar 7, 2011 at 3:08 AM

Nested State was supported in the CTP release. After internal design reviews, we decided to remove Nested State support in the coming official StateMachine Release. Hierarchical state machines will be still supported though. In the newer version, there is no restriction on type of activities can be specified for State Entry/Exit activities and Transition Trigger/Actions activities. In theory, user can specify a StateMachine activity as State entry/Exist or Transition Trigger/action.



Tracy Wen

Mar 15, 2011 at 7:30 PM
Edited Mar 15, 2011 at 7:30 PM


 Why did you decide to remove Nested States? We use this in almost all of our workflows. And is there any other way to do this when the offical state machine release happens?


- Joe

Mar 22, 2011 at 2:19 AM

The design of nested states was intended to support the sharing of outgoing transitions between different states. However, nested state support come with several issues. First, the concept of nested state confuses the simplicity of the State Machine design. Second, it doens't support some cenarios well- for example where a state can share different transitions with multiple states. We decided to remove “Nested States” features from the state machine API to keep OM focus on core State machine principles. One way to mitigate the nested state usage is to migrate shared transition into multiple ones.

Example here:

WF3 nested State                                             WF4

+ ParentState A                                               + StateMachineA

   -- ChildStateX                                                 -- StateX


   -- ChildStateY                                                   -- StateY

   -- SharedTransitionZ                                       ----TransitionZ(2)

In WF4, the shared Transition is migrated to two Transitions: TransitionZ(1) and TransitionZ(2). Both of these Transitions reference common Trigger Activities and Transition Action Activities, but each has its own copy of the Transition definition.