posted on Monday, August 28, 2006 6:38 AM by BayerWhite

Building Custom Activity Validation

Last Saturday at the Jax Code Camp,I gave a session on building custom workflow activities. During the last part of the session, I was having some trouble compiling my activity which was supposed to show how to validate custom properties. I thought I had everything working the night before, but I changed something at the last minute.  Here is what I did...

  1. Declared my dependency properties
  2. Declared my actual properties
  3. Built my class that extends ComponentModel.Compiler.ActivityValidator

My three properties were simple ones... FirstName, LastName and Age, however I wanted to show what happens at design time if data is either forgotten or invalid. Somehow I had removed the PropertyMetaData parameters to the dependancy properties. My validator class was then trying to validate that I had a first/last name and that the age property was not

# re: Building Custom Activity Validation

Thursday, January 11, 2007 9:32 AM by Michelle Richardson
You can get around the "early" validation by enclosing your code in if(activity.Parent != null) so that the calidation is only done if the activity is actually being used in a workflow
What do you think?
(required) 
required 
optional
required