<div>I think you need to use a little bit of magical casting:</div>((AbstractRuleBase) ((InternalKnowledgeBase) kbase).getRuleBase()).addProcess(process);<div><br></div><div>A complete test cold be found here:</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="https://github.com/krisv/jbpm/blob/master/jbpm-flow/src/test/java/org/jbpm/process/ForEachTest.java">https://github.com/krisv/jbpm/blob/master/jbpm-flow/src/test/java/org/jbpm/process/ForEachTest.java</a></div>

<div><br></div><div>I know it is a jbpm&#39;s test, but if you want to use it in drools-flow you only need to change the imports I think.</div><div><br></div><div>Best Regards, </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/2/11 Swindells, Thomas <span dir="ltr">&lt;<a href="mailto:TSwindells@nds.com">TSwindells@nds.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">







<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal">We are currently defining our knowledge base in a spring context file like this:</p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&lt;<span style="background:silver">drools:kbase</span> id=<i>&quot;packKbase&quot;</i>&gt;</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">            &lt;drools:resources&gt;</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                  &lt;drools:resource type=<i>&quot;DRL&quot;</i></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        source=<i>&quot;classpath:pack/drools/1.drl&quot;</i> /&gt;</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                  &lt;drools:resource type=<i>&quot;DRL&quot;</i></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        source=<i>&quot;classpath:pack/drools/2.drl&quot;</i> /&gt;</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                  &lt;drools:resource type=<i>&quot;DRL&quot;</i></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        source=<i>&quot;classpath:pack/drools/3.drl&quot;</i> /&gt;</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                  &lt;drools:resource type=<i>&quot;DRL&quot;</i></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        source=<i>&quot;classpath:pack/drools/4.drl&quot;</i> /&gt;</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                  &lt;drools:resource type=<i>&quot;DRF&quot;</i></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        source=<i>&quot;classpath:pack/drools/FLOW.rf&quot;</i> /&gt;</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">            &lt;/drools:resources&gt;</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">            &lt;drools:configuration&gt;</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                  &lt;drools:mbeans enabled=<i>&quot;true&quot;</i> /&gt;</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">            &lt;/drools:configuration&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      &lt;/<span style="background:silver">drools:kbase</span>&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">Ie a load of drl files and a rulesflow file.</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">We’ve now decided that we would rather generate the ruleflow programmatically rather than in an rf file (the process is very very regular and so it will be a lot quicker to just generate
 it).</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">What is the best way to add a programmatically declared process to the rest of the knowledge base?</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">Thanks,</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">Thomas</span></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
**************************************************************************************<br>
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the <a href="mailto:postmaster@nds.com" target="_blank">postmaster@nds.com</a> and delete it from your system as well as any copies. The content of e-mails as well as traffic data
 may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.<br>
<br>
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00<br>
**************************************************************************************<br>
</font>
</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>