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

data data data.deutrium at gmail.com
Tue Jun 1 15:34:09 EDT 2010


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

regards
Mark


2010/5/31 Michael Neale <michael.neale at 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.
>
> 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
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20100601/48ba40f2/attachment.html 


More information about the rules-dev mailing list