<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="3">
<div><font color="#0000FF"> </font></div>
<div><font color="#0000FF"> </font></div>
<div><font face="Tahoma, sans-serif" size="1">______________________________________________ </font></div>
<div style="padding-left: 72pt; text-indent: -72pt; "><font face="Tahoma, sans-serif" size="1"> </font></div>
<div style="padding-left: 72pt; text-indent: -72pt; "><font face="Tahoma, sans-serif" size="1"> </font></div>
<div><font face="Tahoma, sans-serif" size="1" color="#0000FF"><font face="Verdana, sans-serif" size="2"> </font> </font></div>
<div><font face="Verdana, sans-serif" size="2" color="#0000FF"> </font></div>
<div><font face="Verdana, sans-serif" size="2">Hi ,</font></div>
<div><font face="Verdana, sans-serif" size="2">I am facing this weird issue when I try running a Stateful session created from 2 different package files (one is the main flow and the other is the sub flow. I am using SNAPSHOT jars for the 5.1.0 version. (<a href="https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/"><font color="#0000FF"><u>https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/</u></font></a>)</font></div>
<div><font face="Verdana, sans-serif" size="2"> </font></div>
<div><font face="Verdana, sans-serif" size="2">The only difference being that I am loading the main process and the sub process from 2 different package files (in my case a BLOB in the database).</font></div>
<div><font face="Verdana, sans-serif" size="2">The processes run individually; But when I tie them up (have a Re-usable sub process node in the main flow) together I get the below exception,</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#0000FF"> </font></div>
<div><font face="Verdana, sans-serif" size="2"><u>CONSOLE OUTPUT BELOW</u></font></div>
<div><font face="Verdana, sans-serif" size="2"> </font></div>
<div><font face="Verdana, sans-serif" size="2"> </font></div>
<div><font face="Courier New, monospace" size="2">SUBPROCESS Node 1</font></div>
<div><font face="Courier New, monospace" size="2">SUBPROCESS Node 2</font></div>
<div><font face="Courier New, monospace" size="2">SUBPROCESS Node 1</font></div>
<div><font face="Courier New, monospace" size="2">SUBPROCESS Node 2</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000">java.lang.NoSuchMethodError: com.qwest.Process_com_qwest_0.action2(Lorg/drools/spi/KnowledgeHelper;Lorg/drools/spi/ProcessContext;)V</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at com.qwest.Process_com_qwest_0Action2Invoker.execute(<font color="#000080"><u>Process_com_qwest_0Action2Invoker.java:20</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.node.ActionNodeInstance.internalTrigger(<font color="#000080"><u>ActionNodeInstance.java:54</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(<font color="#000080"><u>NodeInstanceImpl.java:112</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(<font color="#000080"><u>NodeInstanceImpl.java:148</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(<font color="#000080"><u>NodeInstanceImpl.java:135</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.ExtendedNodeInstanceImpl.triggerCompleted(<font color="#000080"><u>ExtendedNodeInstanceImpl.java:37</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(<font color="#000080"><u>StateBasedNodeInstance.java:101</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(<font color="#000080"><u>StateBasedNodeInstance.java:82</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.node.SubProcessNodeInstance.internalTrigger(<font color="#000080"><u>SubProcessNodeInstance.java:122</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(<font color="#000080"><u>NodeInstanceImpl.java:112</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(<font color="#000080"><u>NodeInstanceImpl.java:148</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(<font color="#000080"><u>NodeInstanceImpl.java:135</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.node.ActionNodeInstance.triggerCompleted(<font color="#000080"><u>ActionNodeInstance.java:62</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.node.ActionNodeInstance.internalTrigger(<font color="#000080"><u>ActionNodeInstance.java:58</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(<font color="#000080"><u>NodeInstanceImpl.java:112</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(<font color="#000080"><u>NodeInstanceImpl.java:148</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(<font color="#000080"><u>NodeInstanceImpl.java:135</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.node.ActionNodeInstance.triggerCompleted(<font color="#000080"><u>ActionNodeInstance.java:62</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.node.ActionNodeInstance.internalTrigger(<font color="#000080"><u>ActionNodeInstance.java:58</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(<font color="#000080"><u>NodeInstanceImpl.java:112</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(<font color="#000080"><u>NodeInstanceImpl.java:148</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(<font color="#000080"><u>NodeInstanceImpl.java:135</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.node.StartNodeInstance.triggerCompleted(<font color="#000080"><u>StartNodeInstance.java:49</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.node.StartNodeInstance.internalTrigger(<font color="#000080"><u>StartNodeInstance.java:41</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(<font color="#000080"><u>NodeInstanceImpl.java:112</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.ruleflow.instance.RuleFlowProcessInstance.internalStart(<font color="#000080"><u>RuleFlowProcessInstance.java:16</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.process.instance.impl.ProcessInstanceImpl.start(<font color="#000080"><u>ProcessInstanceImpl.java:185</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.start(<font color="#000080"><u>WorkflowProcessInstanceImpl.java:284</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.common.AbstractWorkingMemory.startProcess(<font color="#000080"><u>AbstractWorkingMemory.java:1763</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.common.AbstractWorkingMemory.startProcess(<font color="#000080"><u>AbstractWorkingMemory.java:1741</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#FF0000"> at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(<font color="#000080"><u>StatefulKnowledgeSessionImpl.java:284</u></font>)</font></div>
<div><font face="Courier New, monospace" size="2" color="#0000FF"> </font></div>
<div><font face="Courier New, monospace" size="2" color="#0000FF"> </font></div>
<div><font face="Courier New, monospace" size="2" color="#0000FF"> </font></div>
<div><font face="Courier New, monospace" size="2" color="#0000FF"> </font></div>
<div><font face="Verdana, sans-serif" size="2">I create the KnowledgeSession usign the code below,</font></div>
<div><font face="Verdana, sans-serif" size="2"> </font></div>
<div><font face="Verdana, sans-serif" size="2"> </font></div>
<div><font face="Verdana, sans-serif" size="2"> <font face="Courier New, monospace">conf = KnowledgeBaseFactory.</font><font face="Courier New, monospace"><i>newKnowledgeBaseConfiguration</i></font><font face="Courier New, monospace">();</font></font></div>
<div><font face="Courier New, monospace" size="2"> conf.setOption(EventProcessingOption.<font color="#0000C0"><i>STREAM</i></font>);</font></div>
<div><font face="Courier New, monospace" size="2"> builder = KnowledgeBuilderFactory.<i>newKnowledgeBuilder</i>();</font></div>
<div><font face="Courier New, monospace" size="2"> </font></div>
<div><font face="Courier New, monospace" size="2"> <font color="#7F0055"><b>for</b></font> (<u>Iterator</u> iterator = <b>flowList</b>.iterator(); iterator.hasNext();) {</font></div>
<div><font face="Courier New, monospace" size="2"> RFFlowInfoT rfFlowInfo = (RFFlowInfoT) iterator.next();</font></div>
<div><font face="Courier New, monospace" size="2"> pkgBytes = rfFlowInfo.getPkgFile();</font></div>
<div><font face="Courier New, monospace" size="2"> <font color="#7F0055"><b>try</b></font> {</font></div>
<div><font face="Courier New, monospace" size="2"> ByteArrayInputStream bInputStream = <font color="#7F0055"><b>new</b></font> ByteArrayInputStream(pkgBytes);</font></div>
<div><font face="Courier New, monospace" size="2"> <font color="#7F0055"><b>if</b></font> (bInputStream == <font color="#7F0055"><b>null</b></font>) {</font></div>
<div><font face="Courier New, monospace" size="2"> System.<font color="#0000C0"><i>out</i></font>.println(<font color="#2A00FF">"Unable to create input stream from the pkg"</font>);</font></div>
<div><font face="Courier New, monospace" size="2"> } <font color="#7F0055"><b>else</b></font> {</font></div>
<div><font face="Courier New, monospace" size="2"> builder.add(ResourceFactory.<i>newInputStreamResource</i>(bInputStream), ResourceType.<font color="#0000C0"><i>PKG</i></font>);</font></div>
<div><font face="Courier New, monospace" size="2"> }</font></div>
<div><font face="Courier New, monospace" size="2"> } <font color="#7F0055"><b>catch</b></font> (Exception e) {</font></div>
<div><font face="Courier New, monospace" size="2"> e.printStackTrace();</font></div>
<div><font face="Courier New, monospace" size="2"> }</font></div>
<div><font face="Courier New, monospace" size="2"> }</font></div>
<div><font face="Courier New, monospace" size="2"> </font></div>
<div><font face="Courier New, monospace" size="2"> KnowledgeBase kbase = KnowledgeBaseFactory.<i>newKnowledgeBase</i>(conf);</font></div>
<div><font face="Courier New, monospace" size="2"> kbase.addKnowledgePackages(builder.getKnowledgePackages());</font></div>
<div><font face="Courier New, monospace" size="2"> kSession = kbase.newStatefulKnowledgeSession();</font></div>
<div><font face="Courier New, monospace" size="2"> </font></div>
<div><font face="Courier New, monospace" size="2"> <font color="#7F0055"><b>try</b></font> {</font></div>
<div><font face="Courier New, monospace" size="2"> <font color="#7F0055"><b>final</b></font> ProcessInstance <u>process</u> = kSession.startProcess(<font color="#2A00FF">"mainFlow"</font>);</font></div>
<div><font face="Courier New, monospace" size="2"> <font color="#7F0055"><b>int</b></font> <u>iResult</u> = kSession.fireAllRules();</font></div>
<div><font face="Courier New, monospace" size="2"> System.<font color="#0000C0"><i>out</i></font>.println(<font color="#2A00FF">"rules fired! hopefully!!"</font>);</font></div>
<div><font face="Courier New, monospace" size="2"> } <font color="#7F0055"><b>catch</b></font> (Throwable e) {</font></div>
<div><font face="Courier New, monospace" size="2"> e.printStackTrace();</font></div>
<div><font face="Courier New, monospace" size="2"> }</font></div>
<div><font face="Courier New, monospace" size="2"> </font></div>
<div><font face="Courier New, monospace" size="2"> </font></div>
<div><font face="Verdana, sans-serif" size="2">The <font face="Courier New, monospace"><b>flowList </b></font>has contains 2 objects (main flow and the sub flow in the field pkgFile which is a byte array I get reading from a BLOB in the database). When I run,
I notice that the sub process starts executing first and then the exception is thrown (as shown in the console output above)</font></div>
<div><font face="Verdana, sans-serif" size="2"> </font></div>
<div><font face="Verdana, sans-serif" size="2"> </font></div>
<div><font face="Verdana, sans-serif" size="2">I have attached the rf files in this mail.</font></div>
<div><font face="Verdana, sans-serif" size="2"> </font></div>
<div><font face="Verdana, sans-serif" size="2">Please let me where I am going wrong?</font></div>
<div><font face="Verdana, sans-serif" size="2"> </font></div>
<div><font face="Verdana, sans-serif" size="2">One more thing to note is that this issue does not arise if I create one single Package object (containing both main flow and sub flow rf xml files). </font></div>
<div><font face="Verdana, sans-serif" size="2">It works fine when I create the KnowledgeSession from the same code above (just that the flowList now contains only one object of Package class which has both the main flow and sub flow combined)</font></div>
<div><font face="Verdana, sans-serif" size="2"> </font></div>
<div><font face="Verdana, sans-serif" size="2">Is this a bug or is there something I am doing wrong.</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#0000FF"> </font></div>
<div><font face="Verdana, sans-serif" size="2" color="#0000FF">Regards,</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#0000FF">Mahesh</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#0000FF"> </font></div>
<div><br>
</div>
<div><font color="#0000FF"><u> ________________________________ </u></font></div>
<div><font face="Arial, sans-serif" size="1" color="#808080">This communication is the property of Qwest and may contain confidential or<br>
privileged information. Unauthorized use of this communication is strictly<br>
prohibited and may be unlawful. If you have received this communication<br>
in error, please immediately notify the sender by reply e-mail and destroy<br>
all copies of the communication and any attachments.<br>
</font></div>
</font>
</body>
</html>