Hi!
I am currently working on a software that uses NativeActivities to describe a sequence consisting of different objects, but the GetParentchain class does not seem to work.
Supposing I have the Native Activities : Globe, Continent, Country, City., which are used asModelItems
Globe has a collection of coninents, countries, and cities
Continent cas a collection of countries and cities
and countries has a collection of cities.
I want to Validate the the above rules using a the CheckParent Function example on the msdn Declarative constraints webpage.
After writing the constraint exactly as described above and callling it throuth the following snippet , the constraint does not seem to work
public static ValidationResults Validate_ModelItem(ModelItem item) { ValidationResults results = null; results = ActivityValidationServices.Validate((NativeActivity)item.GetCurrentValue()); return results; }Using the same method to get the childrem of each Activity, I get the desired results.
While looking into the variables on real time I notice that the Parent is always null and the actual parent of my object is under the Parent/Parent tag
Any suggestions/ideas?