The Problem SolverWIndows Workflow Foundation
HomeShow ChangesEditPrintRecent ChangesSubscriptionsLost and FoundFind ReferencesRename

Search

History

15-12-2006 16:12:12

List all versions

Xoml And Declarative Rules
.
Summary

When using code based workflows with DeclarativeRules you can use an expression like:

        this.myCustomActivity1.TestValue == True

in the RuleConditionEditor and everything works just fine. When you create a XOML based workflow this does not work. The activities added have a private scope and are not visible by the rules engine. The expression above, even though the RuleConditionEditor claims it is perfectly valid, will produce an error with the following text:

        Activity 'ifElseBranchActivity1' validation failed: Property "Condition" has invalid value. Condition expression is invalid. The field "myCustomActivity1" on type "WorkflowConsoleApplication1.Workflow4" does not exist or is not accessible.

If the WorkflowCompiler is used, ie XOML with code beside, this is a compile time error. If the workflow is loaded as pure XOML this is a runtime error.

Changing the DeclarativeRules expression to:

        ((WorkflowConsoleApplication1.MyCustomActivity)this.GetActivityByName("myCustomActivity1")).TestValue

works exually well in both code and XOML.

Wiki Usage

This wiki site is supposed to be a shared resource. As a shared resource everyone is encouraged to add new content or modify existing content!

Enjoy the WF wiki.

Recent Topics