Can anyone provide a complete example to correctly use OnValidate, OnValidateSuccess and OnValidateFailure?