Yeah, I'm aware of that. Still, I find it easier, even for a unit test, to write a DRL snippet<br><br>rule "initTest"<br>when<br>then<br> SomeFact sf = ...<br> insert( sf );<br>end<br><br>and add this in the setup, possibly even compiled from a java.lang.String.<br>
<br>YMMV.<br>-W<br><br><div class="gmail_quote">2012/1/9 Esteban Aliverti <span dir="ltr"><<a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
There is a full api that let you instantiate and manipulate declared types in Java code: <a href="http://docs.jboss.org/drools/release/5.4.0.Beta1/drools-expert-docs/html_single/index.html#d0e3750" target="_blank">http://docs.jboss.org/drools/release/5.4.0.Beta1/drools-expert-docs/html_single/index.html#d0e3750</a><div>
<br></div><div>Best Regards,<br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<span class="HOEnZb"><font color="#888888"><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></font></span><div><div class="h5"><br>
<br><br><div class="gmail_quote">On Mon, Jan 9, 2012 at 4:20 PM, MarcoMojana <span dir="ltr"><<a href="mailto:marco.mojana@exmachina.ch" target="_blank">marco.mojana@exmachina.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
Ok laune, but I would like to create this objects inside a junit test (so in<br>
a method defined in a *.java file), not from the drl itself. Were you<br>
suggesting a workaround?<br>
<br>
--<br>
MM<br>
<br>
<br>
laune wrote<br>
<div>><br>
> I've found that creating objects and facts from DRL-declared classes is<br>
> easily done in DRL, in RHS code.<br>
> -W<br>
><br>
<br>
<br>
</div><span><font color="#888888">--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Instantiate-fact-class-declared-only-in-drl-tp3644780p3644822.html" target="_blank">http://drools.46999.n3.nabble.com/Instantiate-fact-class-declared-only-in-drl-tp3644780p3644822.html</a><br>
</font></span><div><div>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" target="_blank">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>
</div></div></blockquote></div><br></div></div></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>