Is it possible to create a WCF workflow using the standard (Activity template) Workflow activity templates? And, if so, where can I find some samples that DO NOT use the standard WCF service template (WCF Workflow Service template)?
Explanation: I'm trying to discover, load and run workflows at runtime, including workflows with WCF activities. Standard workflows get compiled into types (which makes them easy to discover), however the "WCF Workflow Service" template is an xamlx file, which is added as content and loaded as a manifest stream at runtime. This makes discovery at runtime difficult.
I don't think it is a requirement to use this template to create a service, as the WorkflowServiceHost can take an Activity in its constructor.
I'm trying to keep the task of developing a new WCF service to be discovered, loaded and "executed" (i.e., loaded and listening) at runtime as streamlined as possible.
I have been trying to figure out the same since yesterday and now I stumbled upon a workaround. There is no template for simple workflow (xaml) in VS 2010 when adding new item. If you create a WCF WF Application, you get xamlx. I created a Workflow Console application instead, that gave me a xaml file which I copied to my working project. Once this was done, hosting was simple using WorkflowServiceHost.
string uri = "http://localhost:8008/MyService";
WorkflowServiceHost wsh = new WorkflowServiceHost(new Workflow1(), new Uri(uri));
ServiceMetadataBehavior metadataBehavior = new ServiceMetadataBehavior();
metadataBehavior.HttpGetEnabled = true;
wsh.Description.Behaviors.Add(metadataBehavior);
wsh.AddServiceEndpoint("IService", new BasicHttpBinding(), uri);
wsh.Open();