The Problem Solver

Tell me and I will forget
Show me and I will remember
Involve me and I will understand
- Confucius -

Google Ads

This Blog

Syndication

Search

Tags

News





  • View Maurice De Beijer's profile on LinkedIn

Community

Email Notifications

Explore

Archives

Workflow activity properties not usable in a XOML workflow while they are in a code based workflow

Today I ran into a annoying difference between XOML and code based workflows. In a project I have created a custom activity with a public property. I add this activity to a state workflow and add an IfElseActivity below it. Now I want to use the previously added activity property in the declarative rule condition.

In a code based state workflow I can type “this.myCustomActivity1.TestValue == True” into the rule condition editor. The editor indicates the expression is valid and compiling the project succeeds.

However when I do the same in a XOML with code separation state workflow things work differently. I can still add the custom activity and the IfElseActivity. The first time I try to use the custom activity in the rule condition editor the doesn’t show the this.myCustomActivity1. Adding a condition of true and compiling the project makes this.myCustomActivity1 visible in the rule condition editor. Now I can add “this.myCustomActivity1.TestValue == True” and the rule condition editor indicates everything is correct. However when I compile the project produces errors that the field "myCustomActivity1" on type "WorkflowConsoleApplication1.Workflow2" does not exist or is not accessible.

Now this is a bit of a PITA as it means creating a public property for every condition I need to test and there is little sense in creating a public property for a local test Sad

 You can vote for this issue at: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=245819
 

 

Published Fri, Dec 15 2006 15:03 by Maurice
Filed under: , ,

Comments

# re: Workflow activity properties not usable in a XOML workflow while they are in a code based workflow@ Wednesday, January 07, 2009 9:43 PM

On this website (servo-net.blogspot.com/.../david-yacks-blog-workflow-field-on-type.html) there is a solution provided:

Instead of 'this.testActivity1.Field1 == true' You need to type as follows:

((ActivityNamespace.ActivityName)this.GetActivityByName('testActivity1')).Field1 == true"

by Michał Dębiec