Geoffrey,
This is beind developed under JFDI. As soon as it is ready, we will
be able to do:
Match( $day : day )
Match( day.index == ( $day.index + 1 ) )
[]s
Edson
Geoffrey De Smet wrote:
I wanted to write a rule for 2 consecutive matches like this:
Match($day : day);
Match(day.index == $day.index + 1);
or like this:
Match($day : day);
Match(day.getIndex() == $day.getIndex() + 1);
But I had to write it like this:
Match($day1 : day);
Match($day2 : day -> ($day2.getIndex() == $day1.getIndex() + 1));
So I was wondering if there is any non-solvable reason
why drools can't compile
Match(day.getIndex() == $day.getIndex() + 1);
into an implicit predicate with an anonymous variable, like this:
Match($anonymous : day -> ($anonymous.getIndex() == $day.getIndex()
+ 1));
It would make reading the rules a lot more easier :)
The first time I read the drools manual, I just didn't understand
predicates.
If any of the developers agree, I 'll happily make another jira with
testcase patch.
--
---
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @ www.jboss.com
IT executives: Red Hat still #1 for value
http://www.redhat.com/promo/vendor/
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email