Geeks With Blogs
Adrian Hara Working through the .NET maze

After googling it and not getting lucky, I quickly put together a Do-While activity for Windows Workflow Foundation. The thing is basically a copy/pasted (from Reflected code) version of the BAL WhileActivity, with a small change to evaluate the condition at the end (doh!) and some small changes to the designer. I haven't tested it extensively, but at first glance it seems to work. Any feedback is greatly appreciated.

The sad thing is that the WhileActivity in the BAL is sealed, so there's no chance of tweaking it to become a do-while. Also sad is that its designer, designer theme and validator are also sealed, so...umm...I had to copy/paste those too (with small changes of course ). Another annoyance is that I haven't found an obvious way of making the default glyph inside a CompositeActivity go away (or at least move to somewhere else), and a summary look over its designer revealed that it might not be even possible to do. So I had to have the activity display two glyphs in the designer, to distinguish itself from the WhileActivity.

I've created a project on CodePlex ( seems to have some problems with accepting submissions) and since it's my first time there, please be gentle . I've tried uploading the source code into the "Source Code" section, but ran into the lame-o command line "cpc" tool, with which I couldn't do a "addfile *.*", so I gave up (I'm not saying that it can't be done, but if that didn't work...). So I created a release which includes the source code itself, which means you'll have to build it before using the activity.

In the end, I hope I haven't duplicated some code that already exists somewhere out there... You can get the activity at:

Posted on Saturday, September 15, 2007 7:22 PM | Back to top

Comments on this post: Workflow Foundation Do-While Activity

# re: Workflow Foundation Do-While Activity
Requesting Gravatar...
It works geat for me, thank you!
Left by Maya on Jun 24, 2008 5:49 PM

Your comment:
 (will show your gravatar)

Copyright © Adrian Hara | Powered by: