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!

[663 byte] By [KevinHoffman] at [2007-12-23]
# 1

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

Edmundas at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 2
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?

KevinHoffman at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 3

Kevin

for testing purpose, I've downloaded Tom sample : http://blogs.msdn.com/tomlake/archive/2006/05/02/588756.aspx

I've added a CallExternalMethodActivity, and that works.Could you try the same test ?

Serge

SergeLuca at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 4
Turns out the problem was pretty simple. I was using WorkflowConsoleApplication4.exe as my Assembly reference in the XML namespace declaration. I changed it to WorkflowConsoleApplication4 and it worked just fine.
KevinHoffman at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified