[rules-users] Please help - losing hair

Manjax23 manjunatha.n at coreobjects.com
Thu Aug 16 06:56:41 EDT 2007



I think you should use dialect "mvel" when accessing the nested accessors.
and I had some trouble with "mvel" dialect in 4M2 release.

Please let me know if it works for you..

Thanks,
Manjax23


Richard Hoberman wrote:
> 
> I'm using Drools 4 (M2), which is supposed to support nested accessors*
> 
> This works: when Claim( submissionInfo == null), but not this: when
> Claim( submissionInfo.date == null)
> 
> Rule file, SubmissionInfo.java and exception are below.
> 
> What am I missing?
> 
> Richard
> 
> 
> 
> 
> * See
> http://article.gmane.org/gmane.comp.java.drools.user/8079/match=nested+properties,
> which states "Support to nested accessors, property navigation and
> simplified collection, arrays and maps syntax"
> 
> Rule File
> 
> ---------------------------------------------------------------------------------------
> package mvanamibia.claim;
> 
> import java.lang.Object;
> import java.lang.String;
> import java.lang.Double;
> import java.util.Date;
> import java.util.List;
> import java.util.ArrayList;
> import com.sadalbari.mvanamibia.beans.Claim;
> import com.sadalbari.mvanamibia.beans.Mandate;
> import com.sadalbari.mvanamibia.beans.SubmissionInfo;
> import com.sadalbari.mvanamibia.inspector.ClaimEvaluation;
> 
> global ClaimEvaluation evaluation;
> 
> rule "hasDateReceived"
> 
>     when
>         Claim( submissionInfo.date == null )
>     then
>         evaluation.getFailures().add("missing: date received");
> end
> 
> -----------------------------------------------------------------------------------
> 
> Exception
> -----------------------------------------------------------------------------------
> org.drools.rule.InvalidRulePackage: [19,23]: unknown:19:23 mismatched
> token: [@137,471:471='.',<69>,19:23]; expecting type RIGHT_PAREN
>     at org.drools.rule.Package.checkValidity(Package.java:368)
>     at
> org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:250)
>     at
> com.sadalbari.mvanamibia.model.UnregisteredClaimValidationTest.setupWorkingMemory(UnregisteredClaimValidationTest.java:33)
>     at
> com.sadalbari.mvanamibia.model.UnregisteredClaimValidationTest.testMandateClaim(UnregisteredClaimValidationTest.java:56)
> ... Removed 22 stack frames
> FAILED: testEmptyClaim
> org.drools.rule.InvalidRulePackage: [19,23]: unknown:19:23 mismatched
> token: [@137,471:471='.',<69>,19:23]; expecting type RIGHT_PAREN
>     at org.drools.rule.Package.checkValidity(Package.java:368)
>     at
> org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:250)
>     at
> com.sadalbari.mvanamibia.model.UnregisteredClaimValidationTest.setupWorkingMemory(UnregisteredClaimValidationTest.java:33)
>     at
> com.sadalbari.mvanamibia.model.UnregisteredClaimValidationTest.testEmptyClaim(UnregisteredClaimValidationTest.java:42)
> ... Removed 22 stack frames
> 
> 
> ------------------------------------------------------
> SubmissionInfo (relevant bits)
> 
> public class SubmissionInfo implements Serializable {
> 
>     private Date date;
> 
>     public Date getDate() {
>         return date;
>     }
> 
>     public void setDate(Date date) {
>         this.date = date;
>     }
> 
> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help---losing-hair-tf4278339.html#a12179132
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list