Hi Mark,
>> 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.
I think Mvel do support return value constraint, no?
http://docs.codehaus.org/display/MVEL/Basic+Syntax
<
http://docs.codehaus.org/display/MVEL/Basic+Syntax> 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.
On Dec 20, 2007 11:04 AM, Mark Proctor <mproctor(a)codehaus.org
<mailto:mproctor@codehaus.org>> wrote:
Andy Mei wrote:
> Hi Edson,
>
> This is exactly what I am looking for, thanks!
>
> One comment, is it possible to expand on list of operators Drools
> support? Better yet, make it plugable just like EvaluatorDefinition.
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.
>
> Correct me if I am wrong, but here are list of operators Drools
> support:
>
>
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-core/src/main/...
>
<
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-core/src/main/...
>
> 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.
>
> $p : Position ( settlementDate < ( $TODAY - '3D' ) )
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.
>
> I love the project, keep up the good work. I am negotiating with
> management to purchase support contract from Redhat.
great :)
>
> Andy
>
> On Dec 19, 2007 6:26 PM, Edson Tirelli <tirelli(a)post.com
> <mailto:tirelli@post.com>> wrote:
>
>
> Andy,
>
> 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.
>
> []s
> Edson
>
> 2007/12/19, Andy Mei < andy.d.mei(a)gmail.com
> <mailto:andy.d.mei@gmail.com>>:
>
> Hi,
>
> Is there a way I could register my own custom
> EvaluatorFactory?
> Drools ships with DateFactory what compares only dates,
> but no time is included. I would like to compare time as
> well.
> I see that it would be very helpful to include
> capability to register custom EvaluatorFactory.
> Thanks.
>
> Andy
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> <mailto:rules-users@lists.jboss.org>
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> --
> Edson Tirelli
> JBoss Drools Core Development
> Office: +55 11 3529-6000
> Mobile: +55 11 9287-5646
> JBoss, a division of Red Hat @
www.jboss.com
> <
http://www.jboss.com>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org <mailto:rules-users@lists.jboss.org>
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> ------------------------------------------------------------------------
> _______________________________________________ rules-users
> mailing list rules-users(a)lists.jboss.org
> <mailto:rules-users@lists.jboss.org>
>
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org <mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users
------------------------------------------------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users