views:

66

answers:

1

I'm trying to locate examples on how to implement .net 4 workflow into an asp.net site.

So far all of the examples I've come across have referenced workflow as it existed in .net 3.5.. Which is different.

I'd like to avoid having a WCF service container and instead just have the workflows loaded directly by the sites in question.

So, does anyone know of current (vs2010, .net 4) examples for workflow?

+1  A: 

From the sounds of it you want to execute a workflow serially so that the thread is in fact blocked until the workflow completes. This has the potential to be dangerous but if it's your desire then you can use the new WorkflowInvoker type in WF 4 to synchronously execute a workflow even within ASP.NET. Here's an example:

var outputs = WorkflowInvoker.Invoke(new TestWorkflow(), 
            new Dictionary<string, object> 
            {
                { "x", 5},
                { "y", 10}
            });

int result = (int)outputs["Result"];
James Alexander
Thanks for the lead
Chris Lively