[rules-users] Mvel "in" operator and Inline List Question (Elements with range)

Wolfgang Laun wolfgang.laun at gmail.com
Wed Jan 29 16:22:09 EST 2014


You won't be able to improve things with a custom operator because the
expression is still evaluated by the compiler and MVEL. This will give
you -4 from 21-25.

You could provide the expression as a string and parse and evaluate
that, but that's not very convenient either.

Creating sets as objects in Java code and make them available as
static objects in some class might be the best way.

-W

On 29 January 2014 19:22, mattmadhavan <mmadhavan at facs.org> wrote:
> Hello,
> I see the example mvel "in" operator for the inline array as follows:
>
>
> surgeryCode in [00, 12, 13, 15, 19, *20, 21, 22, 23, 24, 25*, 30, 33, 45,
> 48, 55, 56, 65, 66, 70, 80, 90, 99]
>
> If you notice above the codes *21 to 25* are contiguous (Range)
>
> Is it possible to specify in the list a 'short hand' notation like 21-25
> like as follows:
>
> surgeryCode in [00, 12, 13, 15, 19, 20, *21-25*, 30, 33, 45, 48, 55, 56, 65,
> 66, 70, 80, 90, 99]
>
> If Drools does not support it, is writing my own Custom Operator is my only
> option?
>
> Thanks in advance!
>
> Matt'M
>
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Mvel-in-operator-and-Inline-List-Question-Elements-with-range-tp4027912.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


More information about the rules-users mailing list