Passing data into a Windows Workflow Foundation 4 workflow

Passing parameters into a workflow is similar in WF4 as it was in WF3. In both case a Dictionary<string, object> is passed in when creating the workflow instance object. Alternatively when using the WF4 WorkflowInvoker you can pass it into the Invoke() method. This is quite simple but I have never been a fan of the very loose coupling here. basically on the outside you have to create a dictionary with as key something inside of the workflow. No compile time checking. No improvement where, unless you consider the somewhat easier unit testing with the WorkflowInvoker. The actual behavior between … Continue reading Passing data into a Windows Workflow Foundation 4 workflow

The new Windows Workflow Foundation 4 runtime

With WF3 there was a central workflow runtime environment called the WorkflowRuntime and used to manage the lifetime of workflow instances. In WF4 this central class no longer exists and we manage individual workflows. To compare the two, this is what a minimal console application looks like in WF3. It basically runs a workflow and prints a message when done: static void Main(string[] args) { using (WorkflowRuntime workflowRuntime = new WorkflowRuntime()) { workflowRuntime.WorkflowCompleted += delegate(object sender, WorkflowCompletedEventArgs e) { Console.WriteLine("The workflow has completed."); };   WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(WorkflowConsoleApplication1.Workflow1)); instance.Start();   Console.WriteLine("Waiting for the workflow to complete."); Console.ReadLine(); } } … Continue reading The new Windows Workflow Foundation 4 runtime

Getting started with Windows Workflow Foundation 4

As you may have heard Windows Workflow Foundation 4 is not an upgrade from Windows Workflow Foundation 3 (or 3.5). The version numbers might suggest that the previous version was quite mature but in fact it refers to the version of the .NET framework. In fact Windows Workflow Foundation 3 was the first version and 3.5 added only very few features and some bug fixes. And as WF 4 is a complete rewrite we should approach it as a new product and forget just about everything we already know about WF 3. That might be a bit surprising, after all … Continue reading Getting started with Windows Workflow Foundation 4