Hi Bhanu,
Take a look at this post for an example of how to stop messages from being sent based on a condition.