[jboss-user] [jBPM] - Re: How to resume a persisted processInstance?
Ryan Peterson
do-not-reply at jboss.com
Sat Sep 17 13:26:47 EDT 2011
Ryan Peterson [http://community.jboss.org/people/rrpeterson] created the discussion
"Re: How to resume a persisted processInstance?"
To view the discussion, visit: http://community.jboss.org/message/627035#627035
--------------------------------------------------------------
A partial answer I've found after playing with timers:
The time defined by the timer must pass within the method that invokes or retrieves the session in order to fire the next node.
In other words, a string of nodes with a timer (for instance 15 seconds) all nodes will execute up to the timer and then will return, persisting the ksession. If a Thread.sleep() for more than 15 seconds happens before calling session.dispose() in the original session.startProcess(), then the timer completes and the next nodes in the process instance will fire.
Also the same behavior happens retrieving the session via JPAKnowledgeService.loadStatefulKnowledgeSession, if a Thread.sleep() for a length over the timer value happens, then the timer expires and the next node is called.
Is there a way to setup a timer, for instance 2 hours, that when the ksession is retrived will check the time between the creation of the timer node, and current time? Otherwise I don't see how timers would be useful, unless you're willing to dedicate a thread to each processInstance to sit & poll at fixed intervals to check if timers have expired?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/627035#627035]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110917/47f829b8/attachment.html
More information about the jboss-user
mailing list