Boo and WF

This is based upon an example that has been floating around the blogs.
I have removed the Python accent from it (hint you don’t need to use self in a Boo class):

The following is

import System.Workflow.Activities
import System.Workflow.Runtime
import System
class MyWorkflow(SequentialWorkflowActivity):
_codeActivity as CodeActivity
def constructor():
_codeActivity = CodeActivity()
_codeActivity.ExecuteCode += SayHello
_codeActivity.Name = “Hello”
def SayHello(sender, args):
print “Hello”

def Started(sender as object, args as EventArgs):
print “Startedn”
def Completed(sender as object, args as EventArgs):
print “Completed”

tf = MyWorkflow()
rt = WorkflowRuntime()
rt.WorkflowStarted += Started
rt.WorkflowCompleted += Completed
type = tf.GetType()
instance = rt.CreateWorkflow(type)

The following is

<?xml version=”1.0″ ?>

<project name=”wpfdemo” default=”build”>
<property name=”boo.dir” value=”C:/boo/bin” />
<target name=”build” depends=”wpfdemo” />
    <target name=”wpfdemo”>
        <loadtasks assembly=”${boo.dir}/Boo.NAnt.Tasks.dll” />
            <booc output=”wf.exe” target=”exe”>
                    <include name=”” />

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s