<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
These days trunk snapshot is the best place, as it has all the latest
fixes, this is what will make up 4.0.1 when its releases.<br>
<a class="moz-txt-link-freetext" href="http://cruisecontrol.jboss.com/cc/artifacts/jboss-rules">http://cruisecontrol.jboss.com/cc/artifacts/jboss-rules</a><br>
<br>
Mark<br>
<br>
<br>
Manjax23 wrote:
<blockquote cite="mid:12180147.post@talk.nabble.com" type="cite">
  <pre wrap="">I had same problem with 4M2 release. Please upgrade it to either 4.0.0 GA or
4M3 release.
You can also find a sample example ShoppingExample.java and Shopping.drl,
which is self-explanatory.
However, I was not able to test few MVEL features like projections, which i
think if added would make drools even more dynamic.

Thanks,
manjax23


Richard Hoberman wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">1. I can't find any mention of dialects anywhere in the Drools 4
manual.  Am I missing something?

2. I've tried the following after finding a snippet in the archives for
this list:

    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"
        dialect "mvel"
        when
            Claim( submissionInfo == null )
        then
            evaluation.getViolations().add("missing: date received");
    end


but it gives the following exception:

    java.lang.NullPointerException
        at
   
org.drools.rule.builder.RuleBuildContext.&lt;init&gt;(RuleBuildContext.java:115)
        at
    org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:350)
        at
    org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:233)
        at
   
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:157)
        at
   
com.sadalbari.mvanamibia.model.UnregisteredClaimValidationTest.setupWorkingMemory(UnregisteredClaimValidationTest.java:29)
        at
   
com.sadalbari.mvanamibia.model.UnregisteredClaimValidationTest.testEmptyClaim(UnregisteredClaimValidationTest.java:42)
    ... Removed 22 stack frames


Thanks

Richard


Mark Proctor wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">in theory for nested accessors it should switch to the MVEL dialect
automatically. You only need to specify the MVEL dialect explicitely
for eval, return value and consequences.

Mark
Manjax23 wrote:
      </pre>
      <blockquote type="cite">
        <pre wrap="">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:
  
        </pre>
        <blockquote type="cite">
          <pre wrap="">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
<a class="moz-txt-link-freetext" href="http://article.gmane.org/gmane.comp.java.drools.user/8079/match=nested+properties">http://article.gmane.org/gmane.comp.java.drools.user/8079/match=nested+properties</a>,
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]: <a class="moz-txt-link-freetext" href="unknown:19:23">unknown:19:23</a> mismatched
token: [@137,471:471='.',&lt;69&gt;,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]: <a class="moz-txt-link-freetext" href="unknown:19:23">unknown:19:23</a> mismatched
token: [@137,471:471='.',&lt;69&gt;,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
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>


    
          </pre>
        </blockquote>
        <pre wrap="">  
        </pre>
      </blockquote>
      <pre wrap="">------------------------------------------------------------------------

_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  
      </pre>
    </blockquote>
    <pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>


    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
</blockquote>
<br>
</body>
</html>