Microsoft Developer Network > Samples >
Windows Workflow Foundation (WF4) - Introduction to State Machine Hands On Lab

Windows Workflow Foundation (WF4) - Introduction to State Machine Hands On Lab

In this lab, you will learn how to build workflows using Windows Workflow Foundation (WF4) and the State Machine activity. 


Select a language
 
 
 
 
 
(15)
4,527 times
12/20/2011
E-mail Twitter del.icio.us Digg Facebook
Add To Favorites
Description
Browse Code
Q and A (12)
C#
Sign in to Ask a Question


  • XamlParseException was unhandled
    2 Posts | Last Post February 01, 2012
    • Hi Ron, I have been enjoyed the presentations you put here. I finished the 'Introduction to WF4 Hands On Lab', which was great for me to understand the WF4 basics. Currently, I am doing the 'Introduction to State Machine Hands On Lab' exercise 1. I finished the exercise by following your video. It seems very straight forward. I successfully ran the test without any issue to get it passed. However, when I tried to run the application through either Start Debugging/Start Without debugging, I ran into an exception which seems related to some binding issue shown as below. Any idea why it is happening? I tried to load up the exercise End solution and go the issue.
      
      Thanks in advance,
      Lee
      
      'The invocation of the constructor on type 'AtmStateMatchine.WPF.MainWindow' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'.
      
    • Seen the same problem with exercise 1. And the WPF project 'End' solution of exercise 1 is referecing the AtmStateMachine.Activities of the begin solution. After fixing that, the 'End' solution will run.
      
      Thanks,
      
      Sander
  • AssertState does not exist
    3 Posts | Last Post December 18, 2011
    • Hi Ron,
      Apologies if a basic question, but downloaded latest and used the Exercise1\Begin .sln and am getting - The name 'AssertState' does not exist in the current context in the AtmMachineTests.cs file. Think I've installed all pre-reqs, the Microsoft.Activities classes don't seem to have it anywhere and there's not attribute decoration or recognisable static method. Am I missing something?
      
      Also, latest download seems to contain a reference to a TFS connection which I guess you've used for development. Not that it's an issue, more unexpected in accordance with the lab videos.
      
      Thanks
    • Just to add a little more, so as not to confuse on entry below, I have downloaded the latest from the link above. Thanks
    • Lab is updated - please try again.
  • AssertState does not exist
    2 Posts | Last Post December 18, 2011
    • Hi Ron
      
      I am facing the same issue as Nedster657. I have download the lab on Friday 17th Dec 2011.
      
      I would also like to mention that I am finding your labs of WF very useful.
      
      Thanks
      SG
      
    • Ok - I found the problem - I've uploaded a new version of the labs that should work for you.  
  • Having Trouble with AssertState.OccursInOrder
    3 Posts | Last Post December 14, 2011
    • Hi Ron,
      
      I'm working through this lab and I'm having trouble with the Test project.  The AssertState.OccursInOrder comes up as a does not exist in current context error.  I've tried several workarounds but nothing seems to solve it.  I tried using the  AssertHelper.OccursInOrder, but I then get an error that says that it cannot infer the type arguments from the usage.  
      
      Am I missing something in the configuration? 
      
      Thanks for your help!
    • Sorry about that - I'm checking on this.  I'll post a reply soon.
    • Found a problem with my build system - I've fixed it and created a new release - labs updated also - thanks for the heads up!
  • WF4 State Machine can support parallel?
    1 Posts | Last Post November 26, 2011
    • WF4 State Machine can support parallel?
      or Flowchart support  parallel?Thanks!
  • Code comments
    1 Posts | Last Post November 24, 2011
    • Thank you for the tutorial and all the info to WF and State Machine. If I have one wish, that would be cleaner code. Are you using some tool to auto-comment the code or did you wrote the comments by hand? Example:
      
              /// <summary>
              ///   Gets or sets KeyPadCommand.
              /// </summary>
              public ICommand KeyPadCommand { get; set; }
      
      Somehow, it must be by hand, because sometimes the period is missing or the property name is divided by spaces. Anyway: with all those unnecessary comments, the code is hard to read.
  • Rehosting Error
    3 Posts | Last Post October 31, 2011
    • Thanks for a great tutorial, really helped a lot! I was trying to rehost the AtmActivity.xaml state machine but this causes an error, after a little investigating I found the cause, the xaml file references the argument AtmSettings class locally. Do you know a work around for this problem? Country: Wales
    • So if you load the XAML in a rehosted designer you are getting a validation error?  What is the code and exception or error you are getting?
    • That is correct; it’s a xaml error that seems to be caused by the State Machine loading a local class that the rehoster cannot access. I was wondering if there is a best practice for the referencing of classes in the Workflow xaml so that external projects are able to access them? Thanks for your response.
      
      The exact error returned by the rehoster is;
      System.Xaml.XamlException: 'The type ‘InArgument(local:AtmSettings)’ of property ‘Settings’ could not be resolved.' Line number '3' and line position '33'.
      
  • Example in ASP.NET
    2 Posts | Last Post October 12, 2011
    • Hi.
      Very well your HOL!
      
      My Question is: Is There any example with ASP.NET 4.0?
      
      Best Regards.
      
      Country: Venezuela
    • You might try the Silverlight / State Machine Workflow Service example.
      http://code.msdn.microsoft.com/Windows-Workflow-f2c91fd7
      
  • StateMachine Services
    3 Posts | Last Post June 21, 2011
    • Ron - Great lab. When did you plan to have a similar hands-on lab for WF 4.0 statemachine services?
    • Working on it now... hopefully soon.
    • Not a lab but we do have a sample - see Windows Workflow Foundation (WF4) - Silverlight / State Machine Workflow Service
      http://code.msdn.microsoft.com/Windows-Workflow-f2c91fd7
  • Persisting state machine and codebehind interaction
    2 Posts | Last Post May 23, 2011
    • Hi Ron,
      
      Wonderful tutorials, but I was wondering if you could complicate them a little.
      
      I was trying to use it as follows:
      
      Have a WCF service layer (non WF implentation, good old code behind WCF service) which, upon a call receipt will restore (from a db) a state machine based on call parameters (session, user, etc...). That state machine would already be in a certain state, then potentially, transition that state machine to a different state, request some data from state machine (as a result of transition, some variables may have changed) and persist it back to db until the next call.
      
      Based on all the literature I've read so far, all the tools to implement above are already available, however I'm having difficulties connecting theory with practice.
      
      Would kindly appreciate examples of accessing State Machine variables from code behind, and examples of storing and restoring a state machine to a persistency store on demand.
      
      Kinds regards,
      Rodion
      
    • I wrote a demo for my Tech-Ed North America session that does this by implementing the State Machine as a Workflow Service.  The video is available at http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/MID305 and I will post the code shortly.
1 - 10 of 12 Items   
« First   < Prev   1  2    Next >   Last »