Scheduling child activities with input parameters

A question on StackOverflow about scheduling child activities with some additional input parameters made me remember that this is kind on not obvious to figure out and even though I new the answer I had to think hard before I could code up a demo. So I figured I might as well post it on my blog for future reference.   The problem is that activities are normally just scheduled and their inputs and outputs are configured using Visual Basic expressions. Most of the time that is just fine and does exactly what you need. However in some cases, as … Continue reading Scheduling child activities with input parameters

Workflow Services and Windows Phone 7

Today I did a fun presentation at the Engineering World Conference in the Netherlands on using the Windows Phone 7 with a Workflow Service hosted on Windows Azure. The sample application, that is complete with all source on CodePlex over here, consists of an expense app on the phone and an ASP.NET MVC site hosting the workflow service. The PowerPoint presentation can be found here. It was a fun session on a fun event   [f1] [f2]

The SqlWorkflowInstanceStore and Windows Azure

As shown previously it isn’t hard to run Workflow Services on Windows Azure. In fact all we need to do is add a bit of extra configuration and we can work as normal. However normally when I am hosting long running workflows in IIS I always add a SqlWorkflowInstanceStore  to store the workflow state when it is not running so we can survive the inevitable IIS AppDomain restarts. Unfortunately this isn’t quite as straightforward as I had hoped.   SQL Azure != SQL Server The important thing to remember is that SQL Azure might be similar to SQL Server but … Continue reading The SqlWorkflowInstanceStore and Windows Azure

Running Workflow Services on Windows Azure

Windows Azure might not support the WCF and WF4 hosting parts of Windows AppFabric bit that doesn’t mean you can’t run workflow services on Windows Azure. After all a workflow is just a .NET 4 type and Windows Azure runs the .NET framework. As a result running a workflow service is quite easy once you know how to configure it.   The web.config file The first problem is that the machine web.config of an Azure virtual machine is different than that on a regular machine. As a result, by default, IIS doesn’t know what to do with a WorkflowService type, … Continue reading Running Workflow Services on Windows Azure

Doing synchronous workflow execution using the WorkflowApplication

The WorkflowApplication is a great way to execute your workflows in process. Usually the fact that the WorkflowApplication is asynchronous is a great thing but there are cases when a little more synchronous execution is nice. For example executing a workflow and updating the state of the user interface is much simpler when the WorkflowApplication.Run() doesn’t finish until all work is done. The key to creating a synchronous WorkflowApplication is using its SynchronizationContext. Normally you set this to SynchronizationContext.Current so everything executes on the current UI thread. However this is still an asynchronous call and the Run doesn’t block. Take … Continue reading Doing synchronous workflow execution using the WorkflowApplication

Calling Workflow Services without Add Service Reference

Sometimes you just don’t want to do an Add Service reference in the client application but still be able to to call a WF4 workflow service. The good thing is that a WF4 workflow service is just another WCF service from the client perspective so almost everything you can do with a regular WCF service you can also do with a workflow service. And calling the service without doing an Add Service Reference first is one of those things. In these examples I am going to use the default workflow service template just to make it easy to get started. … Continue reading Calling Workflow Services without Add Service Reference

Windows Workflow Foundation futures and database access

Ron Jacobs showed a number of really cool new workflow features we can be expecting in the next version of Windows Workflow Foundation during the last PDC in Redmond and Tech-Ed Europe in Berlin. One of the new features he demonstrated where the activities we can use to load data from a SQL server database into our workflow. Most of the new features are really cool but the database activities are not.   Why don’t I like the new database activities With the new ExecuteSqlQuery<T> we are back to typing in a literal SQL string to be executed on the … Continue reading Windows Workflow Foundation futures and database access

Throttling workflow services in WF4

Windows Workflow Foundation 4 makes it real easy to create workflow services that do long running work on a server. However when we are doing long running work there could be an issue with lots of workflows being started and too many workflow instances competing for the same data and threads thereby causing problems like database timeouts or thread pool starvation. To simulate a busy workflow service I have the following sample workflow: The workflow service is started using a WCF request, returns a response, prints a start message, does some work and prints a message that it is done. … Continue reading Throttling workflow services in WF4

Versioning long running Workflow Services in WF4, the code

In my previous WF4 post I described the principal of how to version workflow services using the WCF 4 RoutingService. In that post I described the general problem and solution without going into a lot of detail and showing any code. In this blog post I will add an actual implementation you can use for reference purposes.   The basic layout The solution has three parts. The workflow service with 2 different versions of same workflow. The second version of the workflow has more activities in the tree so it can’t load workflow instances from version 1. Each workflow is … Continue reading Versioning long running Workflow Services in WF4, the code