[rules-users] Trouble using || operator and after evaluator in constraints in 5.4.0.Final

abr alexis.brouard at haulogy.net
Thu Aug 16 08:34:40 EDT 2012


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-evaluator-in-constraints-in-5-4-0-Final-tp4019181p4019186.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list