views:

697

answers:

1

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 rehosted designer, allowing the business user to create/configure workflows that make use of these activities - the business user would then save the workflow as XAML, which can be stored in a location known to the application (database, filesystem etc.), and then when it is necessary for the application to execute a workflow, it can use XamlServices.Load to load the workflow from the specific location and execute it as a DynamicActivity?

How is the workflow saved so that it can later be reserialized with properties and other configuration values? I've tried deserializing a Xaml file saved out of the designer, and also using XamlServices.save().

Are there any potential issues here with using bookmarks/persistence?

As a related question, is there any easy way to "Go back" in a workflow, without defining return branches on every flowchart element? I'm looking at integrating a workflow with a UI for a user to enter responses, which the wf will process, and make decisions based on the input. Through the UI, the user should be able to "Go Back" to a previous input.

+1  A: 

You can use the ActivityXamlServices.Load(path) to load a XAML file. It will return an Activity, actually a DynamicActivity, and you can use a WorkflowApplication to run it.

See my blog post for an exmple.

Maurice
hitch
Not sure if this is always the best approach, in fact I doubt it, but MS seems to be pushing us that way. Using the WorkflowServiceHost gives us most bang for the buck, specially when it comes to long running workflows. And from what I read about AppFabrik WCF is the way to go.Now I think there certainly is a place for other communications/hosting stuff out there so don't dismiss the WorkflowApplication and bookmarks out of hand.
Maurice