Thanks Kris, it worked.
I have one more requirement, now I am able to persist the flow in database but unable to retrieve it from database and restart it. I know we can use "JPAKnowledgeService.loadStatefulKnowledgeSession" to get the persisted session from database, but I am unable to start the process from middle where it was closed. It would great if you can provide a code snippet or example for this.