1 Reply Latest reply on Mar 22, 2012 2:44 AM by Maciej Swiderski

    Resume a process. Same ksession ?

    lakshmi sampath Newbie

      Hi,

       

      I am suspending a process inside a work item handler(by making it async) using a flag that checks if user has reqeusted to suspend a process. I am persisting the instance.

       

      My Question is

       

           Do i need to use the same ksession which initially started the process when I call ksession.getWorkItemManager().completeWorkItem(..) to resume

           or can I create a new ksession and resume a previously suspended process. If I can use new ksession what happens to the old ksesion which is persisted in db.

       

           Note: I am not using any events or timers yet

       

       

      thanks

      lakshmi.

        • 1. Re: Resume a process. Same ksession ?
          Maciej Swiderski Master

          lakshmi sampath wrote:

           

               Do i need to use the same ksession which initially started the process when I call ksession.getWorkItemManager().completeWorkItem(..) to resume

               or can I create a new ksession and resume a previously suspended process. If I can use new ksession what happens to the old ksesion which is persisted in db.

          It depends, if your process is not bound to session state (timers, business rules, etc) you can use another session to resume it. In general, I would recommend to use the same session if that does not introduce too many problems as when session is stored in db it remains there. So if you keep creating new sessions you will run into situation where your session table will become quite big and most likely you will need to have some cleanup routines to maintain it.

           

          HTH