[jboss-user] [jBPM] - Re: Iterate over all existing sessions at startup

Brian Wallis do-not-reply at jboss.com
Fri Feb 11 00:27:08 EST 2011

Brian Wallis [http://community.jboss.org/people/bwallis42] created the discussion

"Re: Iterate over all existing sessions at startup"

To view the discussion, visit: http://community.jboss.org/message/586824#586824

> Mauricio Salatino wrote:
> Hi Brian, you will have a row for each processinstance that you have running inside the ProcessInstanceInfo table. Did you check that? 
> Notice that there is a Status, or Completed field that indicates if the process has ended or not.
> Greetings.
I see that in the code in ProcessInstanceInfo which would let me get the ProcessInstance. But I cannot see any way to find the session from there.

I believe that I need to recreate all the old sessions on restart which is exactly what I need since I can then assert new facts into these sessions which will cause the workflow processes to continue processing (remember, I have a session per process). 

I found a mention of this in an old post by Kris (from Aug 22, 2009):

> So whenever the application needs to be restarted, you must restore the 
> session (either creating a new one or reloading it using the unique 
> session id).  Execution will then continue as before.  For example, if a 
> user then completes a task that was requested by a specific process 
> instance, the engine will automatically know that that user task was 
> related to that specific process instance and reload its previous state 
> from the database. 
> So, as long as you make sure that the session is restarted, all process 
> instances will continue from the state they were at before without you 
> having to do anything. 

but I am still not sure how I do this or whether or not I need to persist the unique session IDs when I create them in the first place


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110211/3107cff0/attachment.html 

More information about the jboss-user mailing list