[jboss-user] [jBPM] - Re: How to get active processes via ksession.getProcessInstances() (Jbpm 5.1.1)

Miljenko Norsic do-not-reply at jboss.com
Mon Oct 10 04:08:42 EDT 2011


Miljenko Norsic [http://community.jboss.org/people/mnorsic] created the discussion

"Re: How to get active processes via ksession.getProcessInstances()  (Jbpm 5.1.1)"

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

--------------------------------------------------------------
Hi,

I spotted the exact same problem (please see  http://community.jboss.org/message/628732#628732 http://community.jboss.org/message/628732, unrelated to your issue, but I have mentioned it as issue found while creating my processes).
It seems that Javadoc about method getProcessInstances() does not imply that in persistent scenario this method returns anything:
"+Returns a collection of currently active process instances.  Note that only process instances that are currently loaded and active inside the engine will be returned.+ 
+When using persistence, it is likely not all running process instances will be loaded as their state will be stored persistently.  It is recommended not to use this method to collect information about the state of your process instances but to use a history log for that purpose.+"

So, I think you have to resort to the following:
1. create your own JPA query to fetch all running process instances for particular knowledge session, or
2. use history log

HTH
Miljenko
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/630820#630820]

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/20111010/00bfdf26/attachment.html 


More information about the jboss-user mailing list