<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Andy Mei wrote:
<blockquote
 cite="mid:a6781a0c0801030851o6350083ey9ada4b1fa819805d@mail.gmail.com"
 type="cite">Hi Mark,<br>
  <br>
&gt;&gt;
what you are using there is a return value constraint, to the engine
its effectively a black box, and is evaluated by the chosen dialect;
mvel or java. So if you want ot be able to do that type of arithmetic,
work with the MVEL author to make sure its incuded in his engine.<br>
  <br>
I think Mvel do support return value constraint, no?<br>
  <br>
   <a moz-do-not-send="true"
 href="http://docs.codehaus.org/display/MVEL/Basic+Syntax">http://docs.codehaus.org/display/MVEL/Basic+Syntax
  </a><br>
</blockquote>
Already said above that we support mvel for return value constraints.
But whether MVEL supports operator overloading in the way you want, I'm
not sure, you would need to speak to the MVEL author.<br>
<blockquote
 cite="mid:a6781a0c0801030851o6350083ey9ada4b1fa819805d@mail.gmail.com"
 type="cite"><br>
  <br>
  <div class="gmail_quote">On Dec 20, 2007 11:04 AM, Mark Proctor &lt;<a
 moz-do-not-send="true" href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt;
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div bgcolor="#ffffff" text="#000000">
    <div class="Ih2E3d">Andy Mei wrote:
    <blockquote type="cite">Hi Edson, <br>
      <br>
This is exactly what I am looking for, thanks!<br>
      <br>
One comment, is it possible to expand on list of operators Drools
support?  Better yet, make it plugable just like EvaluatorDefinition.<br>
    </blockquote>
    </div>
Not yet, this is something we want, but our current approach to using
antlr has limited our flexability there. We would need to rewrite the
grammar, using an antlr-tree parser, then we should be able to have
user definable list of operators.
    <div class="Ih2E3d"><br>
    <blockquote type="cite"><br>
Correct me if I am wrong, but here are list of operators Drools
support: <br>
  <a moz-do-not-send="true"
 href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/evaluators/Operator.java"
 target="_blank">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/evaluators/Operator.java
      </a><br>
      <br>
Would it be possible if I could add additional operators like '+', '-',
'/', '%'... to any objects.  For example, I would love to allow users
to write syntax below, where user could subtract 3 days from the
current day. <br>
      <br>
  $p : Position ( settlementDate &lt; ( $TODAY - '3D' ) )<br>
    </blockquote>
    </div>
what you are using there is a return value constraint, to the engine
its effectively a black box, and is evaluated by the chosen dialect;
mvel or java. So if you want ot be able to do that type of arithmetic,
work with the MVEL author to make sure its incuded in his engine.
    <div class="Ih2E3d"><br>
    <blockquote type="cite"><br>
I love the project, keep up the good work.  I am negotiating with
management to purchase support contract from Redhat.<br>
    </blockquote>
    </div>
great :)<br>
    <blockquote type="cite">
      <div class="Ih2E3d"><br>
Andy<br>
      <br>
      <div class="gmail_quote">On Dec 19, 2007 6:26 PM, Edson Tirelli
&lt;<a moz-do-not-send="true" href="mailto:tirelli@post.com"
 target="_blank">tirelli@post.com</a>&gt;
wrote:<br>
      <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
   Andy,<br>
        <br>
   I just added support for that in trunk (drools-4.1.0.SNAPSHOT).
Although trunk is a work in progress, you are welcome to try it out and
check if it meets your needs and provide feedback. Look for the
interface: org.drools.base.evaluators.EvaluatorDefinition and its
subclasses as examples.<br>
        <br>
   []s<br>
   Edson<br>
        <br>
        <div><span class="gmail_quote">2007/12/19, Andy Mei &lt;<a
 moz-do-not-send="true" href="mailto:andy.d.mei@gmail.com"
 target="_blank">
andy.d.mei@gmail.com </a>&gt;:</span>
        <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
          <div>
          <div>Hi,<br>
          <br>
  Is there a way I could register my own custom EvaluatorFactory? <br>
  Drools ships with DateFactory what compares only dates, but no time
is included.  I would like to compare time as well.<br>
  I see that it would be very helpful to include capability to register
custom EvaluatorFactory. <br>
  Thanks.<br>
          <span><br>
Andy<br>
          </span><br>
          </div>
          </div>
_______________________________________________<br>
rules-users mailing list<br>
          <a moz-do-not-send="true"
 href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
          <br>
          <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
          <br>
        </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
-- <br>
  Edson Tirelli<br>
  JBoss Drools Core Development<br>
  Office: +55 11 3529-6000<br>
  Mobile: +55 11 9287-5646<br>
  JBoss, a division of Red Hat @ <a moz-do-not-send="true"
 href="http://www.jboss.com" target="_blank">
www.jboss.com </a><br>
_______________________________________________<br>
rules-users mailing list<br>
        <a moz-do-not-send="true"
 href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
        <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
        <br>
      </blockquote>
      </div>
      <br>
      </div>
      <pre><hr size="4" width="90%"><div class="Ih2E3d">
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org"
 target="_blank">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </div></pre>
    </blockquote>
    <br>
    </div>
    <br>
_______________________________________________<br>
rules-users mailing list<br>
    <a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
    <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
    <br>
  </blockquote>
  </div>
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
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>
<br>
</body>
</html>