Running an asynchronous workflow with impersonation

I encountered a bit of a curly one today with my workflows. Generally, I am executing [WF] workflows synchronously because I am using them as my business layer implementation for distributed services. This means that in order to return a value from a service call, the workflow needs to complete first. Because [WF] executes asynchronously by default, I am using the ManualWorkflowSchedulerService to execute workflows on the same thread as the calling process. This became a problem when I actual... [More]

Bitten by UserData

I have written some custom activities for [WF], but have recently found a bit of a problem with my implementation. I have wanted to persist information against the workflow instance that contains my custom activity (or many instances of the custom activity). I thought I was being very clever by resolving the owning workflow and then storing my information against the workflows UserData IDictionary property. Even the description of the UserData property sounded appropriate according to my go... [More]

WF and missing build output from referenced project

Ever come across a WorkflowValidationFailedException at runtime even though the project containing the workflow was successfully validated and compiled without any errors? The reason for this occurring is how the compiler manages references. Lets look at a simple solution that contains ProjectA, ProjectB and ProjectC. ProjectA references ProjectB which then references ProjectC. ProjectA contains a form that references ClassB in ProjectB like this: using System; using System.Diagnostics; u... [More]

Does the WorkflowRuntime have a memory leak?

Over the last week at work, we have been doing some testing of our [WCF] services that call into a business layer that uses [WF]. We have the services set as single instance, and we are using a new instance of the WorkflowRuntime for each service call. There are obvious inefficiencies of creating the runtime for each call, but that isn't the issue. The problem is that we noticed that the memory went up and didn't get released (until the AppDomain was unloaded). After a lot of testing, it came do... [More]

WF rules and bitwise OR

I have been doing some [WF] development this morning and came across something interesting. I had a PolicyActivity in which I was trying to assign a bitwise enum value on an object instance. The rules editor gave be an error saying that I couldn't use a bitwise OR operation on the types of operands I was using. It seems to me that CodeDom doesn't correctly parse bitwise OR. From what I have googled this morning, is looks like the [WF] rules engine is supposed to support it. I wasn't however abl... [More]

Orcas March CTP

The Orcas March CTP has been released. There are a few things in the release which I think are really important, at least for my current work. WCF send/receive activity for WF - I was about to write my own and probably will still have to for the 3.0 framework Added support for the new operator in WF rules - hello, why wasn't this available in the 3.0 framework WCF available in XBAP applications - an important step, but unfortunately is restricted to BasicHttpBinding Via Moustafa Khalil.

Be careful of code clean-up's when you have WF projects

I am really enjoying using [WCF] and [WF] in my development. While playing with the new toys can be frustrating at times, it is a whole lot of fun. There are a few gotchas though. The one I want to highlight here is the "Find All References" support in the IDE. Here is a scenario that can bite you. Let's say that I am using PolicyActivities to do pre and post condition validation. I may also be using them to change data in the workflow based on rules. For example, I might need to do some busines... [More]

WF runtime services

I have been looking at [WF] runtime services, specifically the ManualWorkflowSchedulerService for running workflows synchronously. In my research travels this morning, I came across this article on the odetocode site. At a quick read, it seems like Scott Allen has put together a fantastic article with just the right about of information, code and detail.

Adding workflows to a non-WF project

I have been building up a project that I need to add workflows to, only I didn't create the project as a workflow project. This means that when I go to add a new item, I get the standard options along with WPF file types and even an option for a WCF service, but no workflow options. After using WinMerge to compare the project file with a workflow project file, these are the actions I took: Add references to System.Workflow.Runtime, System.Workflow.ComponentModel and System.Workflow.Activities.... [More]

TechEd - Afternoon of Day 1

This afternoon I was going to go to a WF session, but I bailed so that I could spend some time on my session, making sure that the demos were going to behave themselves. Oh, forgot to mention. I got to meet Berno this morning which was really good. In the evening, Chris and I were a little late to 'Ask the experts' because we were able to get access to the room we will give our session in. It was helpful to be able to see the room and check that the VPC works from the main VPC server using my la... [More]