<div dir="ltr"><div><div>5.2.0 does work. Thank you again! I've been trying all day to somehow get around this.<br></div><br></div>I just had to add this to META-INF/drools.default.packagebuilder.conf in drools-compiler-5.2.0.Final.jar to be able to use it with Java 7:<br>
<div><div><div><br>drools.dialect.java.compiler = ECLIPSE<br>drools.dialect.java.lngLevel = 1.6<br>drools.dialect.java.compiler.lnglevel = 1.6<br><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sun, Jul 14, 2013 at 9:04 PM, Davide Sottara <span dir="ltr"><<a href="mailto:dsotty@gmail.com" target="_blank">dsotty@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'll see if I can reproduce it in 5.6.. I'm traveling so it will take a couple of days<br>
T-Mobile. America's First Nationwide 4G Network<br>
<div class="HOEnZb"><div class="h5"><br>
rrdh <<a href="mailto:rrdh@gmx.net">rrdh@gmx.net</a>> wrote:<br>
<br>
>Ah, thanks for letting me know! I'll try an earlier version then.<br>
><br>
><br>
>On Sun, Jul 14, 2013 at 8:54 PM, Wolfgang Laun <<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>>wrote:<br>
><br>
>> It's a bug, possibly a regression from 5.2.0 that has been in 5.3.0,<br>
>> 5.4.0 and is still in 5.5.0.<br>
>><br>
>> It should be very simple to add <a href="http://codetidy.com/6206/" target="_blank">http://codetidy.com/6206/</a> as a test<br>
>> case so that this will be fixed.<br>
>><br>
>> -W<br>
>><br>
>><br>
>> On 14/07/2013, Wolfgang Laun <<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>> wrote:<br>
>> > Which Drools version do you use?<br>
>> ><br>
>> > On 14/07/2013, k <<a href="mailto:rrdh@gmx.net">rrdh@gmx.net</a>> wrote:<br>
>> >> Hi,<br>
>> >> basically it's the same problem this guy had<br>
>> >><br>
>> <a href="http://stackoverflow.com/questions/11485122/non-template-dynamic-rules-in-drools" target="_blank">http://stackoverflow.com/questions/11485122/non-template-dynamic-rules-in-drools</a><br>
>> >> <<br>
>> <a href="http://stackoverflow.com/questions/11485122/non-template-dynamic-rules-in-drools" target="_blank">http://stackoverflow.com/questions/11485122/non-template-dynamic-rules-in-drools</a><br>
>> ><br>
>> >><br>
>> >> , but the links in that question don't work.<br>
>> >><br>
>> >> I'd like to dynamically add rules to a running session, but can use<br>
>> >> 'eval'<br>
>> >> only in the very first one. If I add a second rule like the following,<br>
>> it<br>
>> >> won't execute:<br>
>> >><br>
>> >> ---<br>
>> >><br>
>> >> String test2 =<br>
>> >> "\nrule id4" +<br>
>> >> "\nwhen" +<br>
>> >> "\neval(0 == 0)" + // if this eval is removed, "done2" is inserted<br>
>> >> "\nthen" +<br>
>> >> "\ninsertLogical( \"done2\" );" +<br>
>> >> "\nend";<br>
>> >><br>
>> >> kbuilder.add(ResourceFactory.newByteArrayResource(test2.getBytes()),<br>
>> >> ResourceType.DRL);<br>
>> >><br>
>> session.getKnowledgeBase().addKnowledgePackages(kbuilder.getKnowledgePackages());<br>
>> >><br>
>> >> fired = session.fireAllRules();<br>
>> >> System.out.println(fired); // 0<br>
>> >> effects = session.getObjects();<br>
>> >> assertTrue("fired", effects.contains("done2")); // fails<br>
>> >><br>
>> >> ---<br>
>> >><br>
>> >> You can see the complete Test at <a href="http://codetidy.com/6206/" target="_blank">http://codetidy.com/6206/</a><br>
>> >><br>
>> >> I'm also not sure if this is the correct way to dynamically add rules,<br>
>> so<br>
>> >> please let me know, if there's a better way to add rules from strings.<br>
>> >><br>
>> >> How can I dynamically add new rules to a running session and still use<br>
>> >> eval?<br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> View this message in context:<br>
>> >> <a href="http://drools.46999.n3.nabble.com/Dynamic-Rules-and-Eval-tp4024908.html" target="_blank">http://drools.46999.n3.nabble.com/Dynamic-Rules-and-Eval-tp4024908.html</a><br>
>> >> Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
>> ><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>
><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></div></div></blockquote></div><br></div>