[rules-dev] modify (expr) catch 22
Mark Proctor
mproctor at codehaus.org
Fri Apr 8 09:47:55 EDT 2011
On 08/04/2011 13:17, Michael Anstis wrote:
> OK, answers my question :)
The limitation is it will only work for direct accessors. Anything else
and it gets too hard and expensive to maintain and track.
Mark
>
> It is on the "to do" list already.
>
> On 8 April 2011 13:11, Mark Proctor <mproctor at codehaus.org
> <mailto: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 <mailto:rules-dev at lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
>
> _______________________________________________
> 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/46367d33/attachment-0001.html
More information about the rules-dev
mailing list