workflow-foundation-4

WorkflowElement in Visual Studio 2010 Beta 2

I've downloaded beta 2 of visual studio and followed various tutorials (http://bloggersguides.net/media/p/188.aspx) regarding the creation of custom activities for Workflow. In all of the examples the activity appears to derive from WorkflowElement however it would appear not to exist in beta 2? I also notice that you can't create a Seq...

Loading a workflow stored as XAML in .NET 4.0

What is the syntax for loading a .NET 4.0 Beta2 workflow that was previously created and stored as XAML. The WorkflowElement and WorkflowXamlServices classes no longer exist. I am trying to do something like this (that worked in Beta 1): WorkflowElement wf = WorkflowXamlServices.Load(File.OpenRead("Workflow.xaml")) as WorkflowElemen...

Unit Testing a WF4 Workflowservice

I am playing around with WF4 beta 2 and want to unit test a workflowservice. Perhaps I am missing something, but this does not seem trivial. As far as I can see, I might use WorkflowServiceHost. But I think this is a lot of overhead to create a host and then consume it in the test. Is there not a simple way of testing a workflow servic...

Workflow 4.0 in a single threaded apartment?

I'm looking hard at WF 4.0 right now, but I'm having a hard time figuring out how to run workflows in STA threads. I've got a requirement for constructing XPS documents in a workflow, which means I need to create UI elements (FixedPage), which means the thread running the workflow has to be STA. In 3.0, you could do some magic (I didn'...

Exception practices when creating a SynchronizationContext?

I'm creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I'm wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used to Send (execute synchronously) or Post (execute asynchronously) delegates of type SendOrPostCallback. Although in both cases I invoke the ...

Where can I get/need help creating an in-memory InstanceStore

I've been doing lots of work recently on the new Workflow 4.0. One of the things that would make it easier to whip together test apps would be an in memory InstanceStore. One that holds offloaded workflows in memory for a short while. The documentation on how to create a store is pretty anemic, and the interface on it is pretty compl...

Look and feel of workflow (.net WF4, beta2)

can i change the standard look and feel of a sequential workflow back to the wf 3.5 look and feel? I miss the on DragOver automatically expanding arrows between the elements. If this is not possible, can i change the xaml of my activities to a similar to .net 3.5 wf visibility? Thanks! ...

Activity Databinding in wf 4.0

Hi there, i want to display some datatypes in a combobox. the datatypes are wrapped in the following class: public class TDataTypeBinder: INotifyPropertyChanged { private string name; public string Name { get { return name ; } set { name = value; On...

What's the pattern for design-time validation in Workflow Foundation 4.0?

I'm unclear about when and how I should be doing validation in my custom activities/custom activity factories/custom designers in WF 4.0. The only place within my activity that seems to provide validation error support is within the CacheMetadata method (I believe this is called multiple times during the design process). Is this wher...

Long running workflow in .NET 4.0 problem adding required references

I am attempting to complete the following "how-to" in order to try and understand how persistence works in .NET 4.0 Workflows. MSDN - How to: Create and Run a Long Running Workflow Unfortunately, there seems to be an error in the documentation or I have a problem with my setup, as I am unable to add references to the following compone...

Workflow 4.0 custom activity to start external process

I am trying out Workflow 4.0 and hoping to write a custom activity to start an external executable, wait for that process to complete and then resume subsequent steps in the workflow. I found the following example that shows (towards the bottom of the page) how to write an activity to waiting for a file to arrive in a specific directo...

Windows Workflow Foundation 4.0 and Persistence

I'm using Visual Studio 2010 Beta 2 to learn to use Workflow Foundation (WF) version 4.0 prior to the upcoming release of Visual Studio 2010. One thing I've noticed is that if I persist a Workflow in the SQL Database persistence store, and then load it back into the application later and complete the workflow, the record is removed from...

Windows Workflow Foundation 4.0 and Persistence

I'm using the Beta 2 version of Visual Studio 2010 to get a head start on learning to use WF4, and have run into a problem with persistence. In the code below, if I use the commented out creattion of a WorkflowApplication object, persistence works fine. If I use the un-commented creation below, where I pass a dictionary for arguments I...

Windows Workflow Foundation 4.0 Break Out of ForEach<T> Activity

I'm using Visual Studio 2010 Beta 2 to get a head start on learning to use WF4. I'm working in the designer to create a xaml file. I've added a ForEach activity, and inside that ForEach activity have a flowchart that does some conditional processing. I want to be able to break out of the ForEach if one of the conditions is true, but c...

Windows Workflow Foundation 4.0 Pick Activity Containing a Delay Activity

I'm working with Beta 2 of Visual Studio 2010 to get some advanced understanding of WF4. I've created a workflow that has a Pick Activity that is contained in an If Activity. In the Pick Activity I have two Triggers, one that contains a Delay set with a TimeSpan of 10 seconds, the other Trigger has a Bookmark for a manager to approve. ...

How to Invoke a WF3.5 WorkFlow from a WF4 Workflow

Hi, anyone kwnos how to do this? ...

Loading persisted workflow after workflowdefinition has changed in WF4

How to solve this problem (in WF4): I create a workflow in xaml and start several instances of it, I have a persistancestore and all workflows persist on a bookmark half way their workflow. Now I stop the application If I restart te application everything is resumed, en nicely completes. But what if I want to change the workflow defi...

WF4 is it possible to create a designer for a composite activity?

I know how to hook up a designer activity to a NativeActivity or CodeActivity with the Designer attribute on the class. Like so: [Designer(typeof(ParallelActivityDesigner))] I would like to also hookup a designer to a composite activity (composed of some activities in only a xaml file), is that possible at all? ...

Windows Workflow Foundation 4.0 and Tracking

I'm working with the Beta 2 Version of Visual Studio 2010 to get some advanced learning of how to use WF4. I'm using code similar to that in the SqlTracking sample from the SDK, and am trying to track complex objects, of types that I have created, that I have passed into the workflow as arguments. In the CustomerTrackingEventsTable in ...

Rehosting the WF4 designer - how to save and execute workflows created through the rehosted designer.

I'm looking for some clarity with regards to the use of Windows Workflow 4 in an integrated solution - specifically with regards to rehosting the designer and executing workflows created by eg. a business user. Is the intention that the required custom activities are created and compiled into a dll, which is then deployed with the reho...