More info...<br><br>This behavior is reproducible in the Drools JPA test cases.  <br clear="all"><br>
In org.drools.persistence.session.PersistentStatefulSessionTest.testPersistenceState() and testPersistenceRuleSet(), if you add a breakpoint before loading the processInstance the last time (when it is null because the process has &quot;completed&quot;), you can see that processInstance.getState() returns 1 (ACTIVE) instead of 2 (COMPLETE).  I added the ConsoleLogger to the ksession and can see the &quot;AFTER RULEFLOW COMPLETED&quot; log message.<br>
<br>In the other test cases, the state is correctly set to 2 after the process completes.<br><br><div class="gmail_quote">On Mon, Mar 7, 2011 at 11:21 AM, Dan Nathanson <span dir="ltr">&lt;<a href="mailto:dan@ddnconsulting.com">dan@ddnconsulting.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br><br>I&#39;m seeing some odd behavior in Drools Flow 5.1.1.  When using JPA and creating a StatefulKnowledgeSession using JPAKnowledgeService.newStatefulKnowledgeSession(), processes look like they run to completion, but calling RuleFlowProcessInstance.getState() on process instances created froim this knowledge session returns 1 (STATE_ACTIVE).  Calling getActiveNodeIds() throws a NullPointerException.<br>

<br>If I get a StatefulKnowledgeSession without JPA by calling KnowledgeBase.newStatefulKnowledgeSession(), getState() returns 2 (STATE_COMPLETED).<br><br>I added KnowledgeRuntimeLoggerFactory.newConsoleLogger(knowledgeSession) and can see in both cases that the process is complete.<br>

<br>Has this been seen before?  Is it a known bug?  Am I doing something wrong?<br><br clear="all">Regards,<br><font color="#888888"><br>Dan Nathanson<br><br>
</font></blockquote></div><br>