Is it possible to create a WorkFlow (in Workflow-foundation -4) dynamically?
Is it possible to create workflows dynamically? I need to generate a WF dynamically based on a set of business logic and service execution sequence I get as input to the system. Is it possible for me to generate the workflow.xaml dynamically without using the wf d开发者_如何学JAVAesigner and execute in the cloud ?
Yes - you can create xaml file using simple file I/O routines or XML manipulation libraries but the best bet would be using XamlXmlWriter class.
Once workflow xaml is ready, you can execute it using (as sighted in this article)
WorkflowInstance instance = runtime.CreateWorkflow(
XmlTextReader.Create("..\\..\\WorkflowInXML.xml"));
instance.Start();
You can also load activities from xaml in WF4 - check this article for the same.
精彩评论