[rules-users] String length check

Gabor Szokoli szocske at gmail.com
Sat Nov 12 16:02:25 EST 2011


I can't try in mvel/drools right now, but String has length(), not size.

On Sat, Nov 12, 2011 at 1:29 PM, lansyj <lansyjp at gmail.com> wrote:
> Hi folks,
>
> I'm trying to create a guided rule which treats customers differently based
> on the length of their customer ID. The generated rule source is as follows:
>
> rule "OP Customer"
>    dialect "mvel"
>    when
>        $bean : ProgramMemberBean( profileVO.memberID.size() == "8" )
>    then
>        $bean.setSegmentCode( "OP_CUSTOMER" );
>        update( $bean );
> end
>
> Everything seems good to me, but I get the following error upon validation:
>
> [OP Customer] [ERR 101] Line 4:53 no viable alternative at input ')' in rule
> "OP Customer" in pattern ProgramMemberBean
> [OP Customer] [ERR 102] Line 4:55 mismatched input '==' expecting ')' in
> rule "OP Customer" in pattern ProgramMemberBean
>
> Any help is very much appreciated.
>
> Best Regards
>
> -lj
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/String-length-check-tp3502269p3502269.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