[rules-users] Ask for help on rule authoring
Mauricio Salatino
salaboy at gmail.com
Fri Mar 25 13:10:55 EDT 2011
yeah... that it's age? an int?
2011/3/25 Wolfgang Laun <wolfgang.laun at gmail.com>
> You can't use a method call as the left hand side operand in a constraint;
> thus
> age.size() == 0
> is not correct.
>
> Do you really mean
> age == "null"
>
> Probably
> ApplicationData( age == null || age == "" )
> is the right thing to do, provided that ApplicationData.age is a String.
>
> -W
>
>
> On 25 March 2011 17:32, Benson Fung <benson.redhat at gmail.com> wrote:
>
>> Hi,
>>
>> I got the following rule problem.
>>
>> The rule is like :
>>
>> 1. | rule "Rule1"
>> 2. | dialect "mvel"
>> 3. | when
>> 4. | ad : ApplicationData( age == "null" , age.size()
>> == 0)
>> 5. | then
>> 6. | ad.setReturnMsg( "age should not be null or empty"
>> );
>> 7. | end
>>
>> where setReturnMsg is a method of ApplicationData Fact();
>>
>> However, I got the validation error :
>>
>> [Rule1] [ERR 101] Line 4:49 no viable alternative at input ')' in rule
>> "Rule1" in pattern ApplicationData
>> [Rule1] [ERR 102] Line 4:51 mismatched input '==' expecting ')' in
>> rule "Rule1" in pattern ApplicationData
>>
>> Please help what the problem is.
>>
>>
>> Thanks
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
- CTO @ http://www.plugtree.com
- MyJourney @ http://salaboy.wordpress.com
- Co-Founder @ http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110325/c3b4b2c2/attachment.html
More information about the rules-users
mailing list