[rules-users] drools quirks

Matt Young solid at youngdev.net
Sat Sep 18 11:32:58 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

OK I looked closer at what Wolfgang said.  By calling fireAllRules(int
limit) instead of execute(object), my rules now fire and return
immidiately without having to set a false condition for the lhs in the RHS

That still does not give me the ability to properly restrict what
objects the rules can create etc.

On 09/18/2010 10:59 AM, Wolfgang Laun wrote:
> On 18 September 2010 16:15, Matt Young <solid at youngdev.net
> <mailto:solid at youngdev.net>> wrote:
>
> 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
>
>

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users




> _______________________________________________ rules-users mailing
> list rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users

- -- 
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/

iQIcBAEBAgAGBQJMlNuqAAoJEO5jycTTPEzcQ/wQAICJezwHIqTEm4P01vAzvnD+
Mjfgnaea3q8p7d/Vkapej4lOxOJ1tDHl/msa/JgHraTKttgcn8oHzWkavgx9L2+4
VKZBPyU4YUYdfHkE2TVRs0D0Lr/hJwzqP+uA4ryFB+pwGAbf8hpKLZ+8kmWXQfEe
9Towivs+d01BOXK0ob3+2D7ywWeW9nadx1SqBqu3z0tY8pOiN+4R4ucu9VrYpfzF
/uv72pBa5S96suQZTkLO2W7/R79PjSZCzjl+OHIEMyQR4nR0jUpwr6yjp/7o64u4
O6Byo9gcZo1Nqh+q2WAH2LPHAJ48/Btmpl2sp6JRmkUD7ccbvIcj11KGt/VelFMs
Dn7VtzbkcCLGDiU+pRQKytkMyXS0kiWSBsf1u9nD8gMaXXYEChDNO3Su/c6HydmG
lhrKVRk+Jo7UWvjBGB/Mnn3QWpZPHiq8CtcQOcMI8xbeV+vnXrm3fXayaN7qjJ4C
MB1plfW6EIFkbRz6KnCoYalz0/Brb+tLM0Gxn17mL949okVS5K2qC36LOJDWq1qG
DBZTmFiaWgP8fuuN12MI5ZmdTmIDAaRAMKmFAUAI5GB6ajzD7wjKr9Up3OGRWfS3
MIL7fWca61S1Kp4tmQe/SAJJQgSD6vd/nDnpG/LE9B/bUm/mOYpAart4QtAWxnlq
2ow3pOr5GmRc7DOb4DTh
=Gq8a
-----END PGP SIGNATURE-----




More information about the rules-users mailing list