Actually, as far as I remember, getProcessInstances() from a restored session will ALWAYS return an empty list.<br clear="all"><br><div>Best,</div><div><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>

- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br><div class="gmail_quote">2011/3/30 Anderson Neves <span dir="ltr">&lt;<a href="mailto:anderson.ufal@gmail.com">anderson.ufal@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi Stephan.<br><br>Thank you for the replay. Next time I will read the javadoc before asking here.<br><br>Regards,<br>Anderson<br><br>2011/3/30 &lt;<a href="mailto:Stephan.Koops@we4it.com" target="_blank">Stephan.Koops@we4it.com</a>&gt;<div>

<div></div><div class="h5"><br>
&gt;<br>&gt; Hi,<br>&gt;<br>&gt; see javadoc of org.drools.runtime.process.ProcessRuntime.getProcessInstances():<br>&gt;<br>&gt;      * Returns a collection of currently active process instances.  Note that only process<br>


&gt;      * instances that are currently loaded and active inside the engine will be returned.<br>&gt;      * When using persistence, it is likely not all running process instances will be loaded<br>&gt;      * as their state will be stored persistently.  It is recommended not to use this<br>


&gt;      * method to collect information about the state of your process instances but to use<br>&gt;      * a history log for that purpose.<br>&gt;<br>&gt; If no instance is loaded yet, that this behaviour is exactly as described.<br>


&gt;<br>&gt; Mit freundlichen Grüssen/Best regards<br>&gt;<br>&gt; i. A.<br>&gt; Stephan Koops<br>&gt; Software Engineer<br>&gt; We4IT GmbH<br>&gt;<br>&gt;<br>&gt; ***************************************************<br>&gt; Sie wollen aktuelle Informationen zu Lotus-Produkten? Dann besuchen Sie unseren Blog:<br>


&gt;<br>&gt; <a href="http://www.lotus-notes-domino-blog.de" target="_blank">http://www.lotus-notes-domino-blog.de</a><br>&gt; ***************************************************<br>&gt;<br>&gt;<br>&gt; We4IT GmbH<br>&gt; Technologiepark 11<br>


&gt; 33100 Paderborn<br>&gt;<br>&gt; Tel: +49 5251 / 70993 - 24<br>&gt; Fax: +49 5251 / 70993 - 01<br>&gt; Mobil:<br>&gt; E-Mail: <a href="mailto:stephan.koops@we4it.com" target="_blank">stephan.koops@we4it.com</a><br>&gt;<br>

&gt; Internet: <a href="http://www.we4it.com" target="_blank">http://www.we4it.com</a><br>
&gt;<br>&gt; HRB 20740, Amtsgericht Bremen<br>&gt; Geschäftsführer: Stefan Sucker, Vicente Diaz Fernandez<br>&gt; USt.-ID.-Nr. DE 220 859 831<br>&gt;<br>&gt; Diese Nachricht ist vertraulich und ausschließlich für die adressierte Person und/oder Organisation bestimmt. Vertrauliche und/oder spezifische Informationen können hierin enthalten sein. Falls Sie ein nicht beabsichtigter Empfänger dieser Nachricht sind, sind das Kopieren, Verteilen und/oder das Aufnehmen aus dem Inhalt resultierender Handlungen untersagt. Haben Sie diese Nachricht fehlerhaft und/oder unvollständig erhalten, benachrichtigen Sie uns bitte umgehend unter unseren oben genannten Kontaktmöglichkeiten.<br>


&gt; This message is confidential and intended solely for the person or organization to which it is addressed. It may contain privileged and confidential information. If you are not the intended recipient, you should not copy, distribute or take any action on reliance on it. If you have received this transmission in error, please notify us immediately by e-mail at the above address.<br>


&gt;<br>&gt;<br>&gt; From: Anderson Neves &lt;<a href="mailto:anderson.ufal@gmail.com" target="_blank">anderson.ufal@gmail.com</a>&gt;<br>&gt; To: Rules Users List &lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;<br>


&gt; Date: 30.03.2011 05:34<br>&gt; Subject: [rules-users] FAIL - getProcessInstances() from persisted        StatefulKnowledgeSession<br>&gt; ________________________________<br>&gt;<br>&gt;<br>&gt; Hi everybody.<br>&gt;<br>


&gt; I configured the session persistence and persisted an instantiated process. When I get the session from the database and use the method getProcessInstances(), it returns an empty collection. But, when I call getProcessInstance(1), and 1 is the InstanceId of the ProcessInstanceInfo (table that contains the process instance), I get the correct process instance. Is this a bug? See the code below.<br>


&gt;<br>&gt; statefulSession = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, knowledgeBase, null, environment);<br>&gt;<br>&gt; Collation&lt;ProcessInstance&gt; processInstances = statefulSession.getProcessInstances(); // FAIL - return empty collection<br>


&gt;<br>&gt; ProcessInstance processInstance = statefulSession.getProcessInstance(1); // OK - return the process instance<br>&gt;<br>&gt;<br>&gt; Regards,<br>&gt; Anderson_______________________________________________<br>


&gt; rules-users mailing list<br>&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>


&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; rules-users mailing list<br>&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>


&gt;<br><br>
</div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div>