On 18 September 2010 16:15, Matt Young <span dir="ltr">&lt;<a href="mailto:solid@youngdev.net">solid@youngdev.net</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
I just started using drools and this is my first time implementing a<br>
rules engine.  Everything has been pretty smooth but I have  some<br>
quirks that I am not sure I can live with.<br>
1) for some reason, if I execute the Knowlege session against an<br>
object, the knowlege session never returns.</blockquote><div><br>I don&#39;t understand the term &quot;execute...against an object&quot;. Do you mean<br>that you have just one fact inserted befor you call fireAllRules()?<br>
<br>But anyway, this call not returning is almost certainly due to a loop<br>in your rules, or have you made sure that they don&#39;t?<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
  The only way I can get<br>
the ksession to return is to make IF (obj == null) part of the LHS and<br>
make modify($input){setObj(&quot;complete&quot;)} part of the RHS<br>
This seems like a deficiency since I have users writing their own<br>
rules, I can see them forgetting this requirement.</blockquote><div><br>Writing rules is programming, no holds barred :-)<br><br>Look into Domain Specific Languages (DSL) as a cushion for the unwary.<br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
  IS their a way to<br>
get the ksession to firerules only once?  If so what does that look like?<br></blockquote><div><br>kSession.fireUntilHalt( 1 );<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

2) It seems that any code I want can be executed in the RHS.  I could<br>
literally execute something like the following in the RHS.<br>
<br>
byte[] b= new byte[10000000000000]; // Really big memory waste<br>
<br>
I also could just start a bunch of threads.<br>
<br>
The point is that I am intending to let the users write their own<br>
rules but I can&#39;t do that if there are no restrictions on how/what can<br>
be done inside the rules.  Any suggestions?  Are there sandboxes or<br>
filters I can activate to restrict the RHS?<br></blockquote><div><br>Again: DSL.<br><br>Also, Rule Templates might be the starting point; it&#39;d depend on what<br>the may be allowed to do.<br><br>And what about good old-fashioned training?!<br>
<br>-W<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
- --<br>
Cheers,<br>
Matt Young<br>
<a href="mailto:solid@youngdev.net">solid@youngdev.net</a><br>
<a href="http://youngdev.net" target="_blank">http://youngdev.net</a><br>
<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.10 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
iQIcBAEBAgAGBQJMlMmHAAoJEO5jycTTPEzclUwQAJdLYF183A5fSo9cN0a1gkkR<br>
bRyIEgUBUZGQVZi+W7vezQMVqLtV1/+HkfDj5EdylD9fGS6/OsBzOKMCKb4IIuOe<br>
j8xgp4Z85G5JmowhWDh9AYfHMwcOJ/QSjrPm4ABs3ZQilBEeSKcYBNZ/YNX9WhVN<br>
ZMeLwx9+VJqK1Wj4Aue6zdG4XiSA+CTNL309xLgyGkoiWtnp3+wY4Q3q1WGArWti<br>
uIq0tN1xGk9mRkSGepdAjycv5mc+9BCjh6/5UqSIMsWSTqKzm6ce96YQIMgMV77m<br>
J6/ya91eTGiqXXpXsrSKJSHUFe7ExAJjjVZFzXT55FSNRBzrInCXDIyMfH6hX00E<br>
KFQyQWHi3lLRPSKnBpkBGQj1ZPB3WMBvq8Kfjjszzoa3MjmsfNy21YdrSdLUnJPC<br>
NNdBCwYmNbntRu+6fhk8D5OxlLXqAY+OcuVLjySKdBq6eA+Q20XN8+GLWwAjSD8K<br>
vc0/6HAICKzOXhpSiPEFsPSOxT/FSVBXPOmoO0fMoxjOLpEHU2G5CB6lIn8zZngQ<br>
GodDE6s9uOWLsEyxsBCp7Nb9uLNEFXVW91SsYcGQuzCrVgwPR4Dc/KUzOdYUPIaM<br>
RC1laZbdEfrhisZrHAkZDaMSzaYZO48Vb4ZpCJTqCVESdwjRbBLtTG7YNAFBKQQw<br>
BN9Qjq6IJUUJDzfawsrr<br>
=1xoA<br>
-----END PGP SIGNATURE-----<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>
</blockquote></div><br>