Integrating Integrators – BizTalk, Windows Azure, Windows Workflow, and Beyond

March, 2010

Windows Workflow

This is the top level group for Microsoft Windows Workflow Foundation. Find blogs, samples, videos, and learning resources for various versions of workflow including 3.0, 3.5, and 4.0 here.

Windows Workflow Community Blogs via Syndication

Windows Workflow Foundation related bloggers. All content is property of the original blog owner.
  • Windows Workflow Community Blogs via Syndication

    Dynamically binding the expression type in the property grid

    Previously, I demonstrated how to use an ExpressionTextBox in a custom property editor . In this followup post, I will show how to dynamically bind the ExpressionType of the ExpressionTextBox to the type of the argument of the custom activity. We don’t provide a type converter for this out of the box, so you have to write your own. Fortunately this is not hard. Here’s the type converter: using System; using System.Windows.Data; using System.Globalization; namespace Microsoft.CustomTypesAndActivities...
  • Windows Workflow Community Blogs via Syndication

    Using an ExpressionTextBox in a custom property editor

    I have fielded a couple of questions from customers and also a forum post asking how to get the binding correct for the ExpressionTextBox correct in the property grid (well Eric fielded that one with some help on our side, thanks Eric!). For the record here are the details and an explanation. WPF provides an extensibility model that allows you to create custom value editors for properties, here is a walkthrough that demonstrates the process . In your custom editor, you can use any old WPF control...
  • Windows Workflow Community Blogs via Syndication

    Mocks for Unit Testing

    This post is not exactly related to Designer, but something I am looking closely into nowadays. Recently a customer asked, how can he replace one of his long running activities with a different mock activity so that he can still unit test his workflow/composite activity logic. Another scenario would be, how to replace an activity which queries a live Db( or does some other Aysnc work) with a test activity which can query a test Db or even a file during testing. One way is to load the activity in...
  • Windows Workflow Community Blogs via Syndication

    Base Designer with additional adornments II

    Couple of customers reported an issue with applying additional adornments on the designer discussed in this post . The issue was for out of box activities which didn't have a custom designer(were using the ActivityDesigner) itself, the adornments were not working. An example would be the Delay activity. Currently, we don't have a clean solution to this as the ActivityDesigner has an implicit style which is picked up by WPF. And if there is such an implicit style, the App.Resources style in...
  • Windows Workflow Community Blogs via Syndication

    Storing your information into activities during design time

    Continuing with the theme of questions we get from customers: How can we store some specific information into activity. One of the cases might be since we don't provide a unique identifier for an activity, the developer wants to store the unique ids per activity. This way he can differentiate between two activities of the same type in the workflow. This can be accomplished through the ViewStateService. We already use the ViewStateService per activity to store the Expand/Collapse state of the...
  • Windows Workflow Community Blogs via Syndication

    Hiding the Breadcrumb

    We continue to get requests from customers we didnt anticipate. And we continue to solve those problems – some way or the other. This one is that “some way”. I dont love it. But hey, if it helps the customer, it works. The customer wanted a way to hide the breadcrumb. Since we didnt have a specific API to do so, we just asked him to do the following: FrameworkElement e = this .wd.View as FrameworkElement; e.Margin = new Thickness(0, -40, 0, -40); grid1.Children.Add( this .wd.View); We just moved...
  • Windows Workflow Community Blogs via Syndication

    Icons for the Designer

    We have already seen how to have icons for the toolbox items. However, unfortunately, it is not the same way for the icons on the designer surface. Good news though, it is not that difficult. As we create our ActivityDesigner, we essentially need to add the following property: < sap:ActivityDesigner.Icon > < DrawingBrush > < DrawingBrush.Drawing > < ImageDrawing > < ImageDrawing.Rect > < Rect Location ="0,0" Size ="25,25" ></ Rect > <...
  • Windows Workflow Community Blogs via Syndication

    Binding activity properties to a custom control

    Today, for a re-hosted application, generally users have the Designer, Toolbox and the Property Grid. The property grid provided has been hooked up pretty well with the designer. Thus any changes to the properties of an activity on the designer surface are bound pretty tightly with the property grid properties. However, what if you have your custom control and you want to bind the changes on the designer surface with that specific custom control. For example, you have a WPF Textbox in your application...
  • Windows Workflow Community Blogs via Syndication

    Designer in View

    Recently, a customer asked how can we get the designer in focus if we know the Model Item for that activity. This can specifically be of value as you are working with large workflows and huge scrolling for going from top to the bottom. This can now be achieved pretty simple: modelItem.Focus(); Thus, once you know the model item you want to access, call modelItem.Focus and this should bring it in view and set focus on it. Another interesting thing that happened when I was cooking up this sample :Essentially...
  • Windows Workflow Community Blogs via Syndication

    Observing Model Item changes

    One of the customers, recently reported an issue where he was not observing the changes he had just made through the model item on the activity. This is what he was trying: void modelService_ModelChanged( object sender, ModelChangedEventArgs e) { activity.Properties[ "Id" ].SetValue(1); int i = ( int )activity.Properties[ "Id" ].Value; if (i!=1) { throw new BuggerException(); } } …and this was throwing the BuggerException for him. Well, this is actually By Design. One of the devs...
  • Windows Workflow Community Blogs via Syndication

    Adding activities out of box to the VS toolbox

    In the previous posts , we have already see as to how we can get the custom activities shown up in the toolbox. Either the activity is part of your solution or we use the Choose Toolbox Item dialog. However, some of our customers want to deliver their custom activities out of box. Their user shouldn't be asked do a Choose Toolbox Item for every activity they want to use. Even one of our internal customer faced the same problem. Below is the step by step approach in how they went about solving...
  • Windows Workflow Community Blogs via Syndication

    Hostable editor keyboard shortcuts

    In my previous post about keyboard shortcuts , I promised a summary of the hostable editor shortcuts. I waited on purpose until after the RC build to make this post. There were a couple of reasons for holding off: we changed the way WF designer shortcuts were scoped, and a bunch of shortcuts were broken in beta 2 and fixed in RC. Now what you see in the RC build for keyboard shortcuts is pretty much what you get for RTM, so now I’ll get in to the nitty-gritty implementation details. Keyboard shortcuts...
Page 1 of 1 (12 items)