If your ex has expressed an interest in getting back together but is currently dating someone else, one of the best things you can do is ignore his advances. This gives the indication that he doesn't have you wrapped around his finger and could increase his respect for you as his ego deflates.
When you make it obvious that your ex can get you back, even if he has another girlfriend, this shows that you don't mind if the two of you don't enter into a serious relationship again. This is likely to result in a casual relationship between the two of you, in which you are likely to get your feelings hurt again. When a man gets upset because you won't return his calls or texts or won't agree to see him while he has a girlfriend, this is a sign that he is truly still emotionally invested in you. The more upset he becomes, the more likely he is to make the changes that he knows are going to get your attention. While this process may take a while, if the two of you are meant to be together, not contacting your ex for a period of time can prove to be effective.