Condividi tramite


Navigating the WF4 Beta 2 Samples

Hot off the presses (and the download center) come the WF4 Beta 2 samples here.  The team has invested a lot of time into these samples and they provide a good way to get up to speed on the way a particular feature or group of features work together.

Note, there are 2300 files to be unzipped, so hopefully there is a sample in here for everyone.

At a high level, we work down the directory structure from technology, sample type, and then some functional grouping of samples. 

image

 

Within the “Sample Type” we have a few different categories we use.

  • Basic
    • These are “one feature” samples that are used to illustrate how to use a given sample.  Often times they are hosted in the most basic wrapper necessary in order to get the feature to a point where it can be shown. 
    • These are grouped within feature level areas, a few  examples from the samples are:
      • \WF\Basic
        • \BuiltInActivities – how to configure and use the activities that are in the box
        • \CustomActivities
          • \CodeBodied\ – writing activities in code, including async, composite, and leveraging ActivityAction’s
          • \Composite – writing composite activities
          • \CustomActivityDesigners – writing activity designers
        • \Designer – programming against the infrastructure, a tree view designer, and a XamlWriter which will remove view state.
        • \Persistance
        • \Tracking
  • Scenario
    • These are higher level samples that require pulling together a number of features in order to highlight how the features can be combined to enable an application of the technology that might be of interest.  In the WF bucket, you will see things like Compensation and Services, which pull together a number of individual features
    • The ActivityLibrary folder is chock full of interesting sample activities that are useful for seeing how to write activities, as well as code that might be useful in your application.  Some of these are items which we aren’t shipping in the framework but may in the future.   Many of these also include interesting designers as well.  Some of the interesting sample activities in here:
  • Application
    • These samples are used to show how to pull everything together within the context of an application.  For instance, the WorkflowSimulator is described this way:
      • This sample demonstrates how to write a workflow simulator that displays the running workflow graphically. The application executes a simple flowchart workflow (defined in Workflow.xaml) and re-hosts the workflow designer to display the currently executing workflow. As the workflow is executed, the currently executing activity is shown with a yellow outline and debug arrow. In addition tracking records generated by the workflow are also displayed in the application window. For more information about workflow tracking, see Workflow Tracking and Tracing . For more information about re-hosting the workflow designer, see Rehosting the Workflow Designer .

      • The workflow simulator works by keeping two dictionaries. One contains a mapping between the currently executing activity object and the XAML line number in which the activity is instantiated. The other contains a mapping between the activity instance ID and the activity object. When tracking records are emitted using a custom tracking profile, the application determines the instance ID of the currently executing activity and maps it back to the XAML file that instantiated it. The re-hosted workflow designer is then instructed to highlight the activity on the designer surface and use the same method as the workflow debugger, specifically drawing a yellow border around the activity and displaying a yellow arrow along the left side of the designer

  • Extensibility
    • This is a section inside the WCF samples that focuses on the various mechanisms and levels of extensibility

 

I will be blogging more on some of the interesting (to me) individual samples.  What do you think?  Are there samples you’d like to see?  How are you using these, is there anything we can do to make these more useful?

Comments

  • Anonymous
    December 01, 2009
    Hi Matt, This is very helpful.  I'm just starting to go through some of these samples.  I'd like to learn more about ViewStateService and AttachedPropertyService.  There's a post at: http://social.msdn.microsoft.com/Forums/en-IE/wfprerelease/thread/bf4723d5-9ad1-46cb-bee7-d7d8e68674a7 with some discussion between Tim and myself.  More information would be welcome! (Maybe a blog post?) Thanks!

  • Anonymous
    December 01, 2009
    Notre, Thanks for the feedback, I'll make sure to add it to the queue of posts :-) Thanks, matt