Using WF4 bookmarks with IWorkflowInstanceExtension

Note: This blog post is written using the .NET framework 4.0 Beta 2 In this previous blog post I showed how to create an asynchronous activity using the NativeActivity and CreateBookmark to pause a workflow execution. Using that in a WorkflowApplication was easy but what about WorkflowInvoker or WorkflowServiceHost?   So what about using a WorkflowInvoker or a WorkflowServiceHost? Neither the WorkflowInvoker not the WorkflowServiceHost contain a ResumeBookmark function so how do we resume a bookmark using either of those execution hosts? The trick is to use a IWorkflowInstanceExtension.   Using a IWorkflowInstanceExtension Workflow extensions can be of any type … Continue reading Using WF4 bookmarks with IWorkflowInstanceExtension

Bookmarked Activities in WF4

Note: This blog post is written using the .NET framework 4.0 Beta 2 Windows Workflow Foundation 4 introduces the concept of bookmarks to temporarily pause activities. A bookmark is basically a named pause point in an activity. The result is that the workflow runtime doesn’t consider an activity to be finished until all its bookmarks are either resumed or removed.   That last statement isn’t completely true though as it is only the case when the optional BookmarkOptions aren’t specified or specified as None. With BookmarkOptions.MultipleResume a bookmark can be resumed multiple times, de default is just once, so just … Continue reading Bookmarked Activities in WF4

Changing the Icon on a custom activity designer

Note: This blog post is written using the .NET framework 4.0 Beta 2 When I create custom activity designers the icon that appears is usually one of the first things I want to change. Doing so in WF4 isn’t hard once you know where to look but if you don’t can be a bit of a challenge. Suppose I have a simple write line activity like this: [Designer(typeof(MyWriteLineDesigner))] public sealed class MyWriteLine : CodeActivity { // Define an activity input argument of type string public InArgument<string> Text { get; set; }   // If your activity returns a value, derive … Continue reading Changing the Icon on a custom activity designer

Workflow 4 and Visual Basic expressions Survey

The topic of Visual Basic expression in Windows Workflow Foundation 4 seems to be a bit of an item for some people as you can see in the comments to my blog posts about it here. Now personally I don’t think it is such a big deal as it only concerns the expressions entered in the workflow, the main project can still be C# if you so desire.   Anyway the team responsible at Microsoft have created a survey asking for feedback on the subject. So if you have an opinion, and many seem to, please take 5 minutes go … Continue reading Workflow 4 and Visual Basic expressions Survey

Rehosting the Workflow Designer in WF4

Note: This blog post is written using the .NET framework 4.0 Beta 2 With Windows Workflow Foundation 3 it was possible to rehost the workflow designer in your own application. But possible is about all there was to say about it as it was pretty hard to do anything beyond the basics.   With Windows Workflow Foundation 4 live has become much better on the rehosting front [:)] In fact it is possible to create the fully functional and useful workflow editor below in about 200 lines of code. Now that is more like it!   The WorkflowDesigner The WorkflowDesigner … Continue reading Rehosting the Workflow Designer in WF4