If I have a State Machine created in version 3.5 will I be able to upgrade to .Net/WF 4.0, or will I have to re-create the functionality? I heard / read that 4.0 does not support State Machines. Finally, if you have a State Machine in 3.5, what is your plan for migrating to 4.0?
views:
317answers:
5It is correct that WF4 will not support statemachines. However, the 3.5 engine is available so you can run your code in .net 4 but without new features ofcourse.
Workflow 4 whilst not formally supporting the State machine activity does so because its no longer necessary. You can still implement that same functionality using a Flowchart.
I've been using 3.5 up till now but WF4 will make things much simpler.
That a state machine workflow is no longer needed in WF4 is not quite true.
Most, but not all, state machine scenarios are easier to model in a WF4 flowchart. That is the case because most developers used state machine because sequential was not flexible enough. All those cases, and those are probably a majority, are well covered by the flow chart.
However the event driven state machine examples are much harder in WF4. Check the WF4 State Machine Guidance here for more details. And the team at Microsoft has announced they are planning on releasing a state machine for WF4 after the initial version ships with .NET 4.
Since the runtime is different in WF4, you need to use the Interop Activitiy for backward compatability with 3.5 and 3.0 workflow applications. And yes, State machine workflow is not yet supported in WF4.