• mwinkle.blog

    WF4, WCF and AppFabric Sessions @ PDC09

    • 0 Comments

    I’m taking this week off to catch up on everything I haven’t done the last two months and to celebrate the Thanksgiving holiday here in the US.

    PDC was a blast!  It was incredibly awesome to meet so many folks interested in WF and talking with others about how they are using (or plan to use) WF4.  I’ll be following up with a more detailed post on my talk, including demos and code, but I wanted to give a summary of the talks that came from my team at this PDC.  Below is the diagram that breaks down some of the “capabilities” of AppFabric and I have color coded them for the various talks that we gave.  All of the PDC Sessions are available online here.

    image

    WF Talks

    WCF Talks

    AppFabric Talks

    There’s a ton of great content up at the PDC site, plenty to sit back and enjoy! 

  • mwinkle.blog

    A Few Additional Treats @ PDC09

    • 1 Comments

    One fun thing we will be doing this year is using the theater in our lounge/booth area to have a few chalk style presentations.  These will be brief 30 minute demo/ q&a / conversation sessions with somebody from the product team.  These will dive a little deeper and be more interactive about topics we know you’re interested in.  We’d love you to come and just ask a ton of questions here:

    Thursday, 11:00-11:30 / Future Directions for State Machine Workflows  / Alan Ko

    Discuss options for using the State Machine modeling style on WF4, and see a demonstration of a WF4-based State Machine design experience.

    Thursday, 1-1:30 / Migrating WF 3.5 Workflows to WF 4 / Bob Schmidt

    Learn some tips and techniques for migrating your WF 3.5 workflows to the new WF4 runtime, and see a demonstration of a tool that helps automate this process.

    Thursday, 2:00-2:30 / WF Rehosting Deep Dive / Kushal Shah

    See how WF’s rehostable runtime, designer, and debugger can add powerful capabilities to your applications

    I’m excited because we’re going to use this as an opportunity to show some cool stuff that we’re thinking about.  Usual disclaimers apply, some of the stuff here we will show are prototypes, ideas we are looking for feedback, etc, etc.   These are things that we think are important, and your feedback helps us understand what you really need to make these things useful for you

    Stop on by the booth if you’re interested in any of the above topics!

  • mwinkle.blog

    Matt’s PDC Session List

    • 0 Comments

    I’m hoping that this PDC might be a little different and I may actually get to attend some sessions, rather than just prepping for mine (or the others from my team).  I’ve gone through all 22 pages of published talks, and I think there are some interesting ones.  So, without further ado, and with little, if any regard for actual scheduling of talks in relation to mine, here are the talks I would be interested in going to at PDC09.

    Hopefully I can get to 10 of them.

    Session Name

    Comment

    Building Data-Driven Applications Using Microsoft Project Code Name "Quadrant" and Microsoft Project Code Name "M" Doug’s had a few things to say recently, and I think this talk will be interesting.  My team was part of the Quadrant team for a while, and I’m curious to see what they’ve been up to.

    Windows 7 and Windows Server 2008 R2 Kernel Changes

    Anytime that you get to hear Mark talk about the kernel, it’s a great opportunity to learn a lot about a topic we don’t think every day.

    Code Visualization, UML, and DSLs

    The architecture tools team has done some really, really neat stuff to help you understand your code base better. I've found the tools to be really useful when looking at our code base, and I'd like to learn more here.

    Advanced Microsoft SQL Server 2008 R2 StreamInsight

    I've been watching StreamInsight since there was an internal talk on the technology. The capabilities here to do high capacity event stream queries is amazing. I think there are a number of interesting classes of problems where this can be useful and I'd like to find out more

    Introduction to Microsoft SQL Server 2008 R2 StreamInsight

     

    Dynamic Binding in C# 4

    This feature is one that I was excited to hear about in Anders' talk last year. A whole hour on how this works, that's just bliss

    Windows Error Reporting

    This kind of data is gold for folks who are building software.  You can’t catch every bug, or be aware of a video card incompatibility in a certain language on XP SP2, or always know why things might go wrong in your apps.  WER gives you a way to get that kind of data.

    How Microsoft Visual Studio 2010 Was Built with Windows Presentation Foundation 4

    This has been a huge undertaking, and hearing Paul talk about this will be insightful about the challenges faced, the way to integrate large, existing code bases with WPF, native WPF interop, etc.

    Windows Presentation Foundation 4 Plumbing and Internals

    I have a weak spot for deepdives into plumbing like this talk. This kind of knowledge is so useful for building apps on top of WPF to really understand how the pieces work together and what's happening at the low levels

    Future of Garbage Collection

    I got to sit next to Patrick at a dinner and had an amazing convesation that knocked my socks off. This is one of the guys who built the GC in .NET, and hearing the way he thinks will be interesting.

    Microsoft Perspectives on the Future of Programming

    Look at the list of this panel, how could you not want to hear this conversation? Just getting these folks together means there will be some interesting topics with lots of different backgrounds (from Jeffery Snover to Erik Meijer)

    REST Services Security Using the Access Control Service

    Justin is my former partner in crime from our days as technical evangelists, and I have lunch with him regularly and the stuff that he is working with is wicked cool. He's also one of the best presenters in the company, and there is always something I learn about presenting when I watch him talk.

    Data-Intensive Computing on Windows HPC Server with the DryadLINQ Framework

    I'd love to see anything that talks about "familiar declarative syntax of LINQ combined with the fault-tolerant distributed graph scheduling of the Dryad runtime"

    Building Sensor- and Location-Aware Applications with Windows 7 and the Microsoft .NET Framework 4.0

    The location API made me open up my first C++ project in a long time, the range of scenarios that this enables in Win7 is awesome

    Code Contracts and Pex: Power Charge Your Assertions and Unit Tests

    My first "from the labs" talk on the list, Pex and Code Contracts bring some really compelling capabilities to .NET development. This would be great to see.

    Microsoft Application Server Technologies: Present and Future

    This is from my team, and I'm excited to see the reaction to some of the cool stuff we will be talking about in the App Server space

    Rx: Reactive Extensions for .NET

    Erik Meijer is one of those guys I can't get enough of, I'd sign up for the fan club on channel9 if it were available.

    Building Amazing Business Applications with Microsoft Silverlight and Microsoft .NET RIA Services

    Brad is a really great presenter, and this is a whole space I have not had a chance to pay much attention to. I'd love to learn more about the ways to rapidly create business applications.

    SketchFlow: Prototyping to the Rescue

    Having just finished a project with a lot of designer/developer interaction, I have a lot of hope for things like SketchFlow.

    Developing REST Applications with the .NET Framework

    I like watching Don's talks, and REST is kind of a thing these days. Done deal.
  • mwinkle.blog

    Displaying Validation Errors in a Rehosted WF4 Designer

    • 1 Comments

    Here’s a quick one

    “I’d like to find out if the workflow in the designer is valid… is there someway to retrieve the validation errors?”

    Yes, the short answer is that you need to provide an implementation IValidationErrorService.  There is one important method to implement on this interface, ShowValidationErrors which will pass you a list of ValidationErrorInfo objects.

    The next thing that needs to happen is that you need to publish an instance of that new type to the editing context.

    Let’s look at a really simple implementation that will write out the validation errors to the debug log.

    using System.Activities.Presentation.Validation;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    
    namespace VariableFinderShell
    {
        class DebugValidationErrorService : IValidationErrorService
        {
            public void ShowValidationErrors(IList<ValidationErrorInfo> errors)
            {
                errors.ToList().ForEach(vei => Debug.WriteLine(string.Format("Error: {0} ", vei.Message)));
            }
        }
    }

    The final bit is to publish this to the editing context:

    wd.Context.Services.Publish<IValidationErrorService>(new DebugValidationErrorService());

    Now, when editing the workflow in the rehosted app, let’s introduce some errors and then look at the output window.  Note, most of the errors below come from incorrect expressions introduced in the expression editor (putting integers in the wrong place, wrong variable name, etc).

     

    image

  • mwinkle.blog

    Got a cool .NET app? Hang with Tortoises for 12 days

    • 0 Comments

    tortoise

    photo courtesy of flickr user mikeweston 

    This is a something that the .NET team is putting together that has a contest with super cool prizes (seriously, 12 day trip to the Galapagos, for real (as my 4 year old says)).  (obligatory legalese here). If you’ve built a sweet app with the .NET framework, we’d like to hear about it.   So check out http://www.myDotNetStory.com today and enter to win.

  • mwinkle.blog

    Finding the Variables in Scope Within the WF Designer

    • 0 Comments

    In this thread, one of our forum customers asked the question:

    “how do I find all of the variables that are in scope for a given activity in the designer?”

    We do not have a public API to do this.  Internally we have a helper type called VariableHelper that we use to display the list of variables in the variable designer, as well as passed into the expression text box intellisense control.

    image

    image

    One thing that I would like to point out is that if you are implementing your expression editor and want to be able to enumerate the variables (to highlight the tokens that are in scope), your implementation of IExpressionEditorService.CreateExpressionEditor() will get a list of model items that correspond to the inscope variables. 

    Now, if you are not building an expression editor, and want to be able to enumerate all of the in scope variables, you will need to do a little more work.  Here are the basic steps

    1. Go to parent container
    2. Does it contain variables*
    3. Does it have a parent?
    4. Go to parent’s parent
    5. Repeat from step 2

    * This is basically the tricky part, because it is not something we can cleanly determine (and it can also be altered at runtime by adding some additional ones via the CacheMetadata() method.  I’ll describe what the designer is currently doing to accumulate this list, and then talk about designs we could have in a future release.

    Current Approach

    Currently, there are two things that we look for when we navigate up the model item tree.

    1. Collections of Variables name Variables
    2. Variables injected by the use of ActivityAction

    As we walk up the tree, we need to find these.  Let’s first consider the following workflow we will use for our tests:

       1:  wd.Load(new Sequence
       2:  {
       3:      Activities =
       4:      {
       5:          new Sequence
       6:          {
       7:              Activities = 
       8:              {
       9:                  new ForEach<string>
      10:                  {
      11:                      Body = new ActivityAction<string>
      12:                      {
      13:                           Argument = new DelegateInArgument<string> { Name="foo" },
      14:                           Handler = 
      15:                              new Sequence
      16:                              {
      17:                                  Activities = 
      18:                                  {
      19:                                      new WriteLine()
      20:                                  }
      21:                              }
      22:                      }
      23:                  }
      24:              }
      25:          }
      26:      }
      27:  });

    Line 13 is the only one that might look a little different here, I’ll eventually have a post up about ActivityAction that talks in more detail what’s going on there.

    So, this loaded in a rehosted designer looks like the following:

    image  

    Now, let’s look at the code to figure out what is in scope of the selected element.  First, let’s get the selected element :-)

     Selection  sel = wd.Context.Items.GetValue<Selection>();
     if (sel != null)
     {
            ModelItem mi = sel.PrimarySelection;

    mi is now the model item of my selected item.  Let’s write some code to walk up the tree and add to a collection called variables

       1:  while (mi.Parent != null)
       2:  {
       3:      Type parentType = mi.Parent.ItemType;
       4:      if (typeof(Activity).IsAssignableFrom(parentType))
       5:      {
       6:          // we have encountered an activity derived type
       7:          // look for variable collection
       8:          ModelProperty mp = mi.Parent.Properties["Variables"];
       9:          if (null != mp && mp.PropertyType == typeof(Collection<Variable>))
      10:          {
      11:              mp.Collection.ToList().ForEach(item => variables.Add(item));
      12:          }
      13:      }
      14:      // now we need to look action handlers 
      15:      // this will ideally return a bunch of DelegateArguments
      16:      var dels = mi.Properties.Where(p => typeof(ActivityDelegate).IsAssignableFrom(p.PropertyType));
      17:      foreach (var actdel in dels)
      18:      {
      19:          if (actdel.Value != null)
      20:          {
      21:              foreach (var innerProp in actdel.Value.Properties)
      22:              {
      23:                  if (typeof(DelegateArgument).IsAssignableFrom(innerProp.PropertyType) && null != innerProp.Value)
      24:                  {
      25:                      variables.Add(innerProp.Value);
      26:                  }
      27:              }
      28:          }
      29:      }
      30:   
      31:   
      32:      mi = mi.Parent;
      33:  }

    Lines 4-13 handle the case where I just encounter an activity.  Lines 16-29 handle the slightly more tricky case where I need to handle ActivityAction (which ultimately derives from ActivityDelegate).  There are a few loops there but basically I look through all of the properties of the item which inherit from ActivityDelegate.  For each one of those, and for each property on that, I look for properties assignable from DelegateArgument.  As I find them I add them to my collection of model items for variables. 

    In my WPF app, I have a simple list box that shows all of these.  Because of the loosely typed data template I use in my WPF app, I get a pretty decent display since they share common things like ItemType from ModelItem, and a Name that routes through to the underlying Name property both elements share.

    image

    <ListBox Name="listBox1" Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <TextBlock>Foo:</TextBlock>
                    <TextBlock FontWeight="Bold" Text="{Binding Path=ItemType}"/>
                    <TextBlock Text="{Binding Path=Name}"/>
                </StackPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>

     

    Potential Future Approach

    Our approach outlined above is generally correct.  That said, you can imagine a deeply nested data structure on an activity that contain variables that get injected into the scope at runtime.  We need a way for an activity to provide a way to declare how to get all of its variables.  The current approach is one of inspection, which works for all of our activities. In the future we may need to add an extensibility point to allow an activity author to specify how to find the variables that are available to its children.  The way that we could do that is to introduce an “VariableResolver” attribute which points to a type (or maybe a Func<>) that operates on the activity and returns the list of variables.  Actually today you could likely introduce a custom type descriptor that lifted the variables out of the activity and surfaces them in such a way that they would be discovered by the inspection above. 

    Disclaimer: the Potential Future Approach is simply something that we’ve discussed that we could do, it does not represent something that we will do.  If you think that is an interesting extensibility point that you might want to take advantage of down the road, let me know. 

  • mwinkle.blog

    WF4 Beta1 => Beta2 Breaking Changes Document Published

    • 0 Comments

    Fresh on microsoft.com downloads, you can get the details of the major breaking changes that occurred for WF between Beta 1 and Beta 2.

    Get the document here.

    We will publish a similar document for any changes between Beta2 and RTM, although that list should be on the shorter side.  If you have feedback on the document, like the way something is presented or think we could have done a better job explaining it, please let me know.  Either comment here or use the “Email” link on the side.

Page 1 of 1 (7 items)