|
|
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).
Anonymous comments are disabled
|
|