For completeness I can not pass the activity validation, so this is what this post will be about. However, as in the first part of this series I will make it rather easy on myself and provide some links to other posts which describe the things involved quite well.
Adding validation to your activity
The basic things involved in adding validation to your custom activities is again descibed in Keyvan Nayyeri excellent series: How to Write a Validator for Custom Workflow Activity. Morgan Skinner goes a little further in his post Activity Validation describing how to connect a validation error of a property to the property, and to the property window in the designer.
Your options for validation
To validate activities you actually have two possibilities:
- Use a custom validator
- Use the ValidationOptionAttribute attribute
The first option is described in the blog posts mentioned above. How and when to use the attribute is described on The Problem Solver blog in the post Validating workflow activity metadata
Use case: validating the type of your parent activity
In the provided sample code you can find an example on how to validate that the parent activity of an activity is of a certain type. Hope you enjoy it.