Need design Help : Receive Message Event

Hi All ,

I am using Receive Message event to trigger a process model through email and storing all the required email properties using message properties bean.
Whenever the mail comes to inbox and process gets triggered , i am creating a entry in Database and storing all the details(subject,body,to Email,cc Email etc) under single ID .
Now let say user responds to same email , then again process gets triggered and creates a new entry in Database which is kind of duplicate entry for the same request/email .

So i need some help on how should i Group Email Threads under a Single ID.  Whenever there is an email thread on the same topic , then the emails should be consolidated onto a single ID.

Any thoughts ? Please advise .

Thanks in advance.

  Discussion posts and replies are publicly visible