This is a bug.
Note that the equivalent rule
package datelist;
rule "Sample rule"
when
CurrentDate( $now: now )
$obj: MyObject( ## $obj memberOf $list,
myDate == null || myDate after[5d] $now )
MyObjectList( $list: myObjectList contains $obj )
then
System.out.println( "Sample rule activated" );
end
compiles correctly, and so it isn't the "||" alone that causes the
problem; it's the combination of
$obj /* this */ memberOf $list, myDate == null || myDate after[5d] $now
-W
On 16/08/2012, abr <alexis.brouard(a)haulogy.net> wrote:
Oops!
This is a typo when creating the example I mentioned in my previous
message.
Here is the correct rule syntax (the $list variable is bound from
MyObjectList.myObjectList, which is of type java.util.List):
rule "Sample rule"
when
CurrentDate( $now: now )
MyObjectList( $list: myObjectList )
$obj: MyObject(
this memberOf $list,
( myDate == null ||
myDate after[ 5d ] $now ) )
then
System.out.println( "Sample rule activated" );
end
Sorry about the confusion.
Best,
Alexis
Side note: you mentioned 5.4.0 has more strict compile checks but, I've
tried to enter the incorrect syntax in another project (aka something like
"this memberOf $variable" where $variable is not (or does not inherit from)
a Collection or array) and compilation ended successfully.
--
View this message in context:
http://drools.46999.n3.nabble.com/Trouble-using-operator-and-after-evalua...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users