Welcome to SpellCoder Sign in | Join | Help

Boo & Windows Workflow Foundation (WWF)

I think you remember the Boo blog, I said that my next blog will be about Boo & WWF to see if it will success to consume WWF API's that Iron Python failed to consume,
and the result was actually very fast and very great
The code just copy & paste from the Iron Python code and some small changes about 30 seconds work and it works great
the Boo code

import System.Workflow.Activities
import System.Workflow.ComponentModel
import System.Workflow.Runtime
import System
class MyWorkflow(SequentialWorkflowActivity):   
    codeActivity as CodeActivity
    def constructor():
        super()
        self.codeActivity = CodeActivity()
        self.codeActivity.ExecuteCode += self.SayHello
        self.codeActivity.Name = "Hello"
        self.Activities.Add(self.codeActivity)
   
    def SayHello(sender, args):
        print "Hello"

   

def Started(sender as object, args as EventArgs):
    print "Started\n"
   

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(tf.GetType())
instance.Start()
Console.ReadKey()


and the result was

Started
Hello
Completed

which means that this time the CodeActivity works ...
I am very happy with this new laguage and I think that I will make some new codes with other parts of WinFX like WCF using Boo
Regards
Published Thursday, May 11, 2006 4:24 AM by Mohammed Hossam
Filed Under: , ,

Comments

No Comments

Anonymous comments are disabled