[rules-users] New in Drools: Updating facts retrieved in queries

Wolfgang Laun wolfgang.laun at gmail.com
Fri Apr 29 05:28:50 EDT 2011


2011/4/29 Manuel Ortiz <manuel.ortizramos at gmail.com>

>
> import es.simcasva.alarmas.src.MDSVHechoAlarma;
>
>
> query "existe Alarma"  (MDSVHechoAlarma referencia)
>     $alarma : MDSVHechoAlarma(   iIdAlarma == referencia.iIdAlarma,
>
>

> The reported errors are:
>
> Description Resource Path Location Type
> BuildError: Not possible to directly access the property 'iIdAlarma' of
> declaration 'referencia' since it is not a pattern
> AlarmaReglasGenerales.drl /aitor/es/simcasva/alarmas/rules Unknown Drools
> Error
>
>
"referencia" is a query parameter (and not a variable bound to a fact); to
access any of its fields or methods you must use Java notation, requiring
you to use a "return value restriction", hence the parentheses:

 $alarma : MDSVHechoAlarma(   iIdAlarma == ( referencia.getIIdAlarma() ),
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110429/28f97364/attachment.html 


More information about the rules-users mailing list