[rules-dev] guvnor - adding own operators in conditions for eligibility rules

Michael Neale michael.neale at gmail.com
Sun May 30 19:11:58 EDT 2010


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.

FYI javascript has === for identity only equality (ie either side of
operator point to the same object), and == for real (value) equality.

On Mon, May 31, 2010 at 2:55 AM, data data <data.deutrium at 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 that? Any
> hints where I can have a look in order to start with that? (links, class
> names etc.)
>
> Thank you in advance
>
> regards
> Mark
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>


-- 
Michael D Neale
home: www.michaelneale.net
blog: michaelneale.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20100531/c24673a2/attachment.html 


More information about the rules-dev mailing list