RioterDeckers' HeadQuarter

Our opinions about Microsoft technologies and the way we are working with.
Welcome to RioterDeckers' HeadQuarter Sign in | Join | Help
in Search

Nezdeboeuf

[Letter to Santa Claus] : System.Workflow.ComponentModel.Condition

WWF is a fantastic product for at least two reasons: the first it fills a functional lack in .NET and the second is that its architecture is based on a fabulous "pattern": Runtime, IServiceProvider, Host, Executor...

The subject of this blog is the customization of conditions. There are three possible conditions types available: Code condition, Declarative condition and Policy condition. If they deliver an actual productivity gain to elaborate rules and manage them, they don't provide mechanisms to interoperate easily with a custom or proprietary rule system. In the worst case, you could use the Code condition to do it with all the supposed disadvantages (The developer will be constrained to code each time the call to rule system...).
An alternative exists. If you analyze the System.Workflow.ComponentModel.Condition class, you can see that you can create classes which derive from it. So, we could develop a custom condition which will establish a gateway to the custom rule system.



But unfortunately, when you want to use it from the workflow designer, it will be impossible for you to do it. Indeed, the IfElse activity references only two condition types (Code and declarative). Is there a workaround ?
In fact you can always to set the condition property of an IfElseBranch activity programmatically. It is enough to open the designer code file of your workflow and to set the condition property of the IfElseBranch activity selected.



But, of course, we must find another solution. Either Microsoft proposes a IfElseBranch designer that supports custom condition, or we must develop it. In waiting an action from Microsoft, I launched out in the development of a custom IfElseBranch activity. This development was rich in lesson. I propose you to download our work.

Download source code (WWF CTP February).

Published Saturday, October 22, 2005 1:00 AM by raskal
Filed Under:

Comments

 

Nezdeboeuf said:

Introduction
The march showers
keep one's promises, articles about Windows Workflow Foundation are...
June 5, 2006 5:11 PM
Anonymous comments are disabled

This Blog

Post Calendar

<October 2005>
SuMoTuWeThFrSa
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

Syndication

Powered by Community Server, by Telligent Systems