Yes there are 2 packages in the Guvnor sourcecode that control this - but
there isn't a way to plug that stuff in at the moment.
One controls what operators are visible when, and the other controls how it
is rendered to DRL (I can't remember the package names though !).
On Wed, Jun 2, 2010 at 5:34 AM, data data <data.deutrium(a)gmail.com> wrote:
Many thanks for your answer
Yes I am aware of the difference between identity and equality. However I
don't like to discuss if a separate identity/equals operators are a good or
bad idea. I took this only as an example. (We use this for instance in ILOG
JRules to speed up the execution)
What me interests is how Guvnor maps the operators from the guided editor
to the real rule language. How is this done ? And exists there any way to
introduce my own operator ? I don't like to use DSL because I like the idea
of the guided rule editor. Any hints how Guvnor maps the guided rules to the
mvel language and how this can be changed are welcome e.g. Which are the
basic classes from the API therefore ?
Many thanks in advance
2010/5/31 Michael Neale <michael.neale(a)gmail.com>
It actually does equals() comparison when it can - that is drools not
> guvnor specific (there might be some exceptions I am not aware of to this).
> In rules, generally you are talking about values of things, the fact that
> there are pointers to things which may happen to point to the same thing in
> memory is an implementation detail which probably would confuse - hence it
> uses equals.
> So it depends if you are asking for identity == (ie same pointer) - which
> I guess would have to be a new operator (and it may be strange and possibly
> a bad idea). Many brighter minds than me rightfully think that it was a
> design mistake of java to have == only mean pointer equality (including all
> the designers of java itself that I have heard of) - so think carefully what
> you want.
> operator point to the same object), and == for real (value) equality.
> On Mon, May 31, 2010 at 2:55 AM, data data <data.deutrium(a)gmail.com>wrote:
>> I like to add or change the existing operators in the condition part for
>> eligibility rules.
>> - equal to
>> - not equal to
>> - matches
>> - sounds like
>> For instance I like to distinguish between reference compare "==" and
>> deep comparison with "object.equals()". Any ideas how I can achieve
>> Any hints where I can have a look in order to start with that? (links, class
>> names etc.)
>> Thank you in advance
>> rules-dev mailing list
> Michael D Neale
> home: www.michaelneale.net
> blog: michaelneale.blogspot.com
> rules-dev mailing list
rules-dev mailing list