[rules-users] drools quirks

Wolfgang Laun wolfgang.laun at gmail.com
Sat Sep 18 10:59:15 EDT 2010


On 18 September 2010 16:15, Matt Young <solid at youngdev.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I just started using drools and this is my first time implementing a
> rules engine.  Everything has been pretty smooth but I have  some
> quirks that I am not sure I can live with.
> 1) for some reason, if I execute the Knowlege session against an
> object, the knowlege session never returns.


I don't understand the term "execute...against an object". Do you mean
that you have just one fact inserted befor you call fireAllRules()?

But anyway, this call not returning is almost certainly due to a loop
in your rules, or have you made sure that they don't?


>  The only way I can get
> the ksession to return is to make IF (obj == null) part of the LHS and
> make modify($input){setObj("complete")} part of the RHS
> This seems like a deficiency since I have users writing their own
> rules, I can see them forgetting this requirement.


Writing rules is programming, no holds barred :-)

Look into Domain Specific Languages (DSL) as a cushion for the unwary.



>  IS their a way to
> get the ksession to firerules only once?  If so what does that look like?
>

kSession.fireUntilHalt( 1 );


> 2) It seems that any code I want can be executed in the RHS.  I could
> literally execute something like the following in the RHS.
>
> byte[] b= new byte[10000000000000]; // Really big memory waste
>
> I also could just start a bunch of threads.
>
> The point is that I am intending to let the users write their own
> rules but I can't do that if there are no restrictions on how/what can
> be done inside the rules.  Any suggestions?  Are there sandboxes or
> filters I can activate to restrict the RHS?
>

Again: DSL.

Also, Rule Templates might be the starting point; it'd depend on what
the may be allowed to do.

And what about good old-fashioned training?!

-W


> - --
> Cheers,
> Matt Young
> solid at youngdev.net
> http://youngdev.net
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQIcBAEBAgAGBQJMlMmHAAoJEO5jycTTPEzclUwQAJdLYF183A5fSo9cN0a1gkkR
> bRyIEgUBUZGQVZi+W7vezQMVqLtV1/+HkfDj5EdylD9fGS6/OsBzOKMCKb4IIuOe
> j8xgp4Z85G5JmowhWDh9AYfHMwcOJ/QSjrPm4ABs3ZQilBEeSKcYBNZ/YNX9WhVN
> ZMeLwx9+VJqK1Wj4Aue6zdG4XiSA+CTNL309xLgyGkoiWtnp3+wY4Q3q1WGArWti
> uIq0tN1xGk9mRkSGepdAjycv5mc+9BCjh6/5UqSIMsWSTqKzm6ce96YQIMgMV77m
> J6/ya91eTGiqXXpXsrSKJSHUFe7ExAJjjVZFzXT55FSNRBzrInCXDIyMfH6hX00E
> KFQyQWHi3lLRPSKnBpkBGQj1ZPB3WMBvq8Kfjjszzoa3MjmsfNy21YdrSdLUnJPC
> NNdBCwYmNbntRu+6fhk8D5OxlLXqAY+OcuVLjySKdBq6eA+Q20XN8+GLWwAjSD8K
> vc0/6HAICKzOXhpSiPEFsPSOxT/FSVBXPOmoO0fMoxjOLpEHU2G5CB6lIn8zZngQ
> GodDE6s9uOWLsEyxsBCp7Nb9uLNEFXVW91SsYcGQuzCrVgwPR4Dc/KUzOdYUPIaM
> RC1laZbdEfrhisZrHAkZDaMSzaYZO48Vb4ZpCJTqCVESdwjRbBLtTG7YNAFBKQQw
> BN9Qjq6IJUUJDzfawsrr
> =1xoA
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100918/f92d2b57/attachment.html 


More information about the rules-users mailing list