<font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">see javadoc of org.drools.runtime.process.ProcessRuntime.getProcessInstances():</font>
<br>
<br><font size=2 color=#4040c2 face="Courier New">&nbsp; &nbsp; &nbsp;*
Returns a collection of currently active process instances. &nbsp;Note
that only process</font>
<br><font size=2 color=#4040c2 face="Courier New">&nbsp; &nbsp; &nbsp;*
instances that are currently loaded and active inside the engine will be
returned.</font>
<br><font size=2 color=#4040c2 face="Courier New">&nbsp; &nbsp; &nbsp;*
When using persistence, it is likely not all running process instances
will be loaded</font>
<br><font size=2 color=#4040c2 face="Courier New">&nbsp; &nbsp; &nbsp;*
as their state will be stored persistently. &nbsp;It is recommended not
to use this</font>
<br><font size=2 color=#4040c2 face="Courier New">&nbsp; &nbsp; &nbsp;*
method to collect information about the state of your process instances
but to use</font>
<br><font size=2 color=#4040c2 face="Courier New">&nbsp; &nbsp; &nbsp;*
a history log for that purpose.</font><font size=2 face="sans-serif"><br>
<br>
If no instance is loaded yet, that this behaviour is exactly as described.</font>
<br>
<br><font size=2 face="sans-serif"><font face="Arial">Mit freundlichen Grüssen/Best regards</font><br>
<br>
<font face="Arial">i. A.</font><br>
<font face="Arial">Stephan Koops</font><br>
<font face="Arial">Software Engineer</font><br>
<font face="Arial">We4IT GmbH</font><br>
<br>
<br>
<b><font face="Arial">***************************************************</font></b><br>
<font face="Arial">Sie wollen aktuelle Informationen zu Lotus-Produkten? Dann besuchen Sie unseren Blog:</font><br>
<br>
<font face="Arial"><a href="http://www.lotus-notes-domino-blog.de">http://www.lotus-notes-domino-blog.de</a></font><br>
<b><font face="Arial">***************************************************</font></b> <br>
<br>
<br>
<font size="2" face="Arial">We4IT GmbH</font><br>
<font size="2" face="Arial">Technologiepark 11</font><br>
<font size="2" face="Arial">33100 Paderborn</font><br>
<br>
<font size="2" face="Arial">Tel: +49 5251 / 70993 - 24</font><br>
<font size="2" face="Arial">Fax: +49 5251 / 70993 - 01</font><br>
<font size="2" face="Arial">Mobil: </font><br>
<font size="2" face="Arial">E-Mail: stephan.koops@we4it.com</font><br>
<br>
<font size="2" face="Arial">Internet: </font><font size="2" face="Arial"><a href="http://www.we4it.com">http://www.we4it.com</a></font><br>
<br>
<font size="2" face="Arial">HRB 20740, Amtsgericht Bremen </font><br>
<font size="2" face="Arial">Geschäftsführer: Stefan Sucker, Vicente Diaz Fernandez</font><br>
<font size="2" face="Arial">USt.-ID.-Nr. DE 220 859 831</font><br>
<br>
<font size="2" face="Arial">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.</font><br>
<font size="2" face="Arial">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.</font></font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Anderson Neves &lt;anderson.ufal@gmail.com&gt;</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">Rules Users List &lt;rules-users@lists.jboss.org&gt;</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">30.03.2011 05:34</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">[rules-users] FAIL - getProcessInstances()
from persisted &nbsp; &nbsp; &nbsp; &nbsp;StatefulKnowledgeSession</font></table>
<br>
<hr noshade>
<br>
<br>
<br><font size=3>Hi everybody.<br>
<br>
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>
<br>
statefulSession = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId,
knowledgeBase, null, environment);<br>
<br>
Collation&lt;ProcessInstance&gt; processInstances = statefulSession.getProcessInstances();
// FAIL - return empty collection<br>
<br>
ProcessInstance processInstance = statefulSession.getProcessInstance(1);
// OK - return the process instance<br>
<br>
<br>
Regards,<br>
Anderson</font><tt><font size=2>_______________________________________________<br>
rules-users mailing list<br>
rules-users@lists.jboss.org<br>
</font></tt><a href="https://lists.jboss.org/mailman/listinfo/rules-users"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/rules-users</font></tt></a><tt><font size=2><br>
</font></tt>
<br>