[rules-users] Help with LHS expression

Enda J Diggins ejdiggins at gmail.com
Thu Mar 4 11:36:19 EST 2010


Hi Yamil,

It looks to me like you might have another error in your first rule. There
are two closing double quotes in your RHS. This could cause the error you're
seeing.

try:

rule "Header - NumeroArchivo Numerico"
  salience 50
  when
    Map( this["NU_ARCHIVO"] not matches "[0-9]\{3\}")
  then
    listBitacora.add(new BitacoraDTO($map.get("_NUMLINE_"),
                                      "Error en el Encabezado: El número del
archivo debe ser numérico"));
end

For more information:
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html/ch04.html

Section: 4.4.2.3. 103: Failed predicate

Hope it helps!
Enda

2010/3/4 Yamil Bracho <yamilbracho at hotmail.com>

>  Hi
> I have a map that contains some data and I would like to check if a value
> inside this map is numeric.
> I wrote :
>
> rule "Header - NumeroArchivo Numerico"
>   salience 50
>   when
>     Map( this["NU_ARCHIVO"] not matches "[0-9]\{3\}")
>   then
>      listBitacora.add(new BitacoraDTO($map.get("_NUMLINE_"),
>                                       "Error en el Encabezado: El número
> del archivo debe ser numérico""));
> end
>
>
> But I got
>
> [162,0]: [ERR 102] Line 162:0 mismatched input ''[0,-1]: [ERR 103] Line
> 0:-1 rule 'end_key' failed predicate:
> {(validateIdentifierKey(DroolsSoftKeywords.END))}? in rule "Header -
> NumeroArchivo Numerico"
>
> I also try:
>
> rule "Header - NumeroArchivo Numerico"
>   salience 50
>   when
>     Map($nuArchivo : this["NU_ARCHIVO"]),
>     not (eval($nuArchivo not matches "[0-9]\{3\}"))
>   then
>      listBitacora.add(new BitacoraDTO($map.get("_NUMLINE_"),
>                                       "Error en el Encabezado: El número
> del archivo debe ser numérico""));
> end
>
> without success
>
> please somebody help me...
>
> TIA
>
> Yamil
>
> ------------------------------
> Actualízate gratis al nuevo Internet Explorer 8 y navega más seguro<http://www.microsoft.com/spain/windows/internet-explorer/default.aspx>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
Enda J Diggins
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100304/a71bfd6c/attachment.html 


More information about the rules-users mailing list