[rules-dev] modify (expr) catch 22
Michael Anstis
michael.anstis at gmail.com
Fri Apr 8 08:17:40 EDT 2011
OK, answers my question :)
It is on the "to do" list already.
On 8 April 2011 13:11, Mark Proctor <mproctor at codehaus.org> wrote:
> On 08/04/2011 12:39, Geoffrey De Smet wrote:
> > Related to the modify expression,
> > I 've always wondered about this code:
> >
> > rule "MyRule"
> > when
> > $p : Person(name = "Yoda")
> > then
> > modify ($p) {
> > setAge(300)
> > }
> > end
> >
> > Doesn't this create an infinite loop? (In my experience it does or at
> > least it takes a lot longer)
> > Because the modify ($p) schedules any rule using a Person back on the
> > agenda to be re-evaluated,
> > so also that rule, which is evaluated and executed again, modifying $p
> > again, ... hence the infinite loop?
> It would, unless you have slot specific - which Jess does. Slot specific
> is something I really want to add, I think it will resolve a lot of
> recursion problems and make Drools a lot easier to use. I took the slot
> specific problem and genericsed it further for "slot listeners". I
> discussed this here:
> http://blog.athico.com/2010/07/slot-specific-and-refraction.html. I
> think Laune added some refinements to this in a mailing list entry
> somewhere.
>
> Mark
>
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20110408/896a0af8/attachment-0001.html
More information about the rules-dev
mailing list