Sample location needed
Folks, I apologize in advance if this has been asked and answered. I did some due dilligence on google and the local search engine and couldn't come up with anything
1. Anybody know where I can find an example of an application that loads a XOML-only file from disk, activates that workflow, and then runs it?
2. Anybody know what a best practice is for having the workflow control the UI? In other words, I want the workflow to tell my GUI which form should be displayed. I've come up with a couple of ways to do it, but I want the best way to do it - I'm thinking it would involve some event pub/sub, but I'd like to hear what you folks think.
Thanks!
Hello Kevin,
Regarding (1), maybe you can try following method of the System.Workflow.Runtime.WorkflowRuntime class to obtain a WorkflowInstance loading a workflow from a XOML:
public WorkflowInstance CreateWorkflow(XmlReader workflowDefinitionReader, XmlReader rulesReader, Dictionary<string, object> namedArgumentValues)
Edmundas
Yeah, I have been trying to use the CreateWorkflow from an XmlReader instance. The problem is my XOML is attempting to use an ExternalDataExchange interface - it has a CallExternalMethod activity contained in it.
So the top of my XOML looks something like this:
xmlns:sampleapp="clr-namespace:WorkflowConsoleApplication4;Assembly=WorkflowConsoleApplication4.exe"
And then I have a CallExternalMethod activity:
<CallExternalMethodActivity x:Name="DoSomethingCall" InterfaceType="{x:Type sampleapp:ISampleDataExchange}" MethodName="DoSomething">
The interface for the data exchange is defined directly in WorkflowConsoleApplication4.
I get the following error message from the WorkflowValidationException.Errors property:
error 278: Activity 'DoSomethingCall' validation failed: Property 'InterfaceType' is
not set.
Clearly I have set the InterfaceType property... but I'm thinking there's some syntax here I haven't done properly.
Any thoughts anyone?