Main Page

Main Page

Workflow 4: Human based workflows with an Email Approval Sample

One of the questions that a lot of people ask about workflow 4 is how to integrate manual tasks into the workflow process so that humans can be involved and interact with the workflow process. After all, what use is a stateful, long running service if no humans are involved? All of the activities that ship with workflow 4 and many of the samples provided only really cover programmatic activities but what about user interaction, I mean WF4 does not even ship with an email activity. The purpose of this post is to introduce the concept of a manual...

Unit Test Workflow 4 Activities : Dependency Injection

At first glance unit testing workflow activities with dependency injection seems like a no-brainer. For example consider the following activity using constructor-based dependency injection. public class SendEmail : CodeActivity { private readonly IEmailClient emailClient; public SendEmail() : this(new EmailClient()) {} public SendEmail(IEmailClient emailClient) { this.emailClient = emailClient; } public InArgument<string> To { get; set; } public InArgument<string> From { get; set; } public InArgument<string> Subject { get; set; } ...

Unit Testing Workflow 4 Activities : The TestContext Tracking Participant

I’m a big believer in using TestContext in MSTest or Console.WriteLine, Debug.WriteLine etc in your favourite Unit Testing framework to give context to passed or failed tests. Especially if you do CI and have only the test results to look at from the build server to try to understand why a build went wrong. Taking this into account I use a TestContext Tracking Participant to get more visibility into my workflow unit tests. This enables me to see what tracking records have been raised against my invoked workflows. In only a few lines of code you can quickly enable...

Unit Testing Workflow 4 Activities : Basics

Unit testing workflows became a lot easier in WF4. The basic approach is the same as for normal code classes except for a few differences which we will cover in the posts in this series. Lets start off with a simple code activity which will return the time in a given city. public class GetCityTime : CodeActivity<DateTime>{ [RequiredArgument] public InArgument<string> City { get; set; } public InArgument<DateTime> LocalTime { get; set; } protected override DateTime Execute(CodeActivityContext context) { string...

Preview Handlers for Vista and Outlook 2007

Really useful for those xml files that people send you. Download the MSDN Magazine Preview Handlers and then setup the xml file with this really cool utility. It gives explorer and outlook preview capabilities for all sorts of file types.

T4 Templating in C#3.0 / .Net 3.5 and its uses in DSL development

Cut to the chaseOK. So you just want to know how to do it? Modify your template directives to the following. <#@ template inherits="Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation" language="C#v3.5" #> What?..Why? Recently I have been doing a lot of work in Microsoft's Domain Specific Language Tools for Visual Studio. In fact for the past 8 months this has pretty much been my main focus. I've learned a lot of things on the way and it occurred to me that the development of T4 templates used in DSL tools would be made a lot easier with the use of extension methods. To understand why,...

WCF Exceptions and Fault Contracts

I ran across an issue recently trying to get a custom exception across a WCF boundary. The trouble is, WCF does not like to tell you what the problem was, and for good reason. I was thinking about exceptions the wrong way. In reality we do not want to pass exceptions across a WCF service boundary, instead we want to pass a Fault back to the caller. An exception is a CLR concept, it does not make sense to expose this outside of the CLR, despite the fact that an exception contains potentially dangerous information (like the stack trace) which...

What is a comfortable office temperature?

Its 27 degrees Celsius today in our office and it feels like an oven. One of the guys has hooked up a digital multi-meter as a thermometer, you have to love geeks.

Concatenating Delimited Strings with Generic Delegates

I knew this must be possible through generic delegates and eventually found this really useful post by Phil Haack which describes using a generic delegate Join method to concatenate strings. Saves a lot of ugly code if you are using T4 or A-N-Other templating language to produce code from a  Dsl or schema.

Windows Live Writer

Finally the latest version of windows live writer seems to work with my blogging engine. Seems they have made some updates to allow blogware engine support for categories etc. Or maybe I just missed these on previous releases. Anyhoo, looks good.

Full Main Page Archive