<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16890" name=GENERATOR></HEAD>
<BODY>
<DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>Hello 
everyone,</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>I'm new to drools 
&amp; I'm trying my hand at creating a rule-flow in which I&nbsp;can back a 
couple of steps &amp; </FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>the 
KnowledgeSession&nbsp;is restored to&nbsp;the same state it was in earlier. I'm 
using Drools 5.1.0 M1 &amp; Eclipse 3.5.</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>I have a rule-flow 
with the following nodes:</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial 
size=2>A-&gt;B-&gt;C</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>where A would be a 
node asking for an input (our fact), B would be a Rule Task that would apply 
certain rules on our fact &amp; </FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>at C, I may decide 
that I need to back up to node A. Both A &amp; C are custom work 
items.</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>I've managed to 
rollback the transaction (I borrowed a lot of code from the test classes in the 
source, thanks a ton for them).</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>But I just 
can't&nbsp;get my process to start again.</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>I'll paste a couple 
of lines of code from my test class below:</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial 
size=2>.....</FONT></SPAN></DIV><SPAN class=121434212-19102009>
<DIV align=left><FONT size=2><FONT face=Arial>ProcessInstance pi = 
ksession.startProcess(</FONT><FONT color=#2a00ff><FONT face=Arial 
color=#2a00ff>"sampleflow"</FONT></FONT><FONT face=Arial>);</FONT></FONT></DIV>
<DIV align=left><FONT face=Arial 
size=2>ksession.fireAllRules();</FONT></DIV></SPAN>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>&nbsp; </FONT>
<DIV align=left><FONT face=Arial><FONT size=2>ut = (UserTransaction) <B><FONT 
color=#7f0055><FONT color=#7f0055>new</B></FONT></FONT></FONT></FONT><FONT 
face=Arial size=2> InitialContext().lookup( <FONT color=#2a00ff><FONT 
color=#2a00ff>"java:comp/UserTransaction"</FONT></FONT> );</FONT></DIV>
<DIV align=left><FONT face=Arial><FONT size=2>ut.begin();<SPAN 
class=121434212-19102009><EM>//Is beginning the transaction boundary here 
correct?</EM></SPAN></FONT></FONT></DIV><FONT face=Arial 
size=2>.....</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><EM><FONT face=Arial size=2>//Now I roll 
back the transaction depending on the input at node C</FONT></EM></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial 
size=2>ut.rollback();</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><EM><FONT face=Arial 
size=2>.....</FONT></EM></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><EM><FONT face=Arial size=2>//And recreate 
the&nbsp;knowledge session</FONT></EM></DIV>
<DIV><FONT size=2><FONT face=Arial>ksession = 
JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, </FONT><B><FONT 
color=#7f0055><FONT color=#7f0055><FONT 
face=Arial>null</FONT></B></FONT></FONT></FONT><FONT face=Arial size=2>, 
env);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>I expected the 
session to restart the process from node A once it was recreated. Am I going in 
the right direction?</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>Or&nbsp;is 
my&nbsp;basic understanding of how session persistence works in Drools Flow 
flawed?</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=121434212-19102009></SPAN><SPAN class=121434212-19102009><FONT 
face=Arial size=2>I'd really appreciate a push in the right 
direction.</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial size=2>Thanks in 
advance,</FONT></SPAN></DIV>
<DIV><SPAN class=121434212-19102009><FONT face=Arial><FONT size=2><SPAN 
class=506401516-19102009>Mahesh</SPAN>.</FONT></FONT></SPAN></DIV></DIV></BODY></HTML>