<br> The DRL parser requires that the argument expression to a "from" CE be a function call or a chained call to methods. The work around to that is to call the MVEL "function" "return":<br>
<br>$items: LinkedList (size > 1) from collect ( Model ( ) from return( object.getOriginal(null) in spatialIndex.query(...) ) )<br><br> This way, the parser will passthrough whatever he finds inside the return( ... ) to MVEL. Let us know if it works for you. I never tested that.<br>
<br> []s<br> Edson<br>
<br><br><br><div class="gmail_quote">2009/8/5 Simon Thum <span dir="ltr"><<a href="mailto:simon.thum@gmx.de">simon.thum@gmx.de</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Edson Tirelli wrote:<br>
> Simon,<br>
><br>
> Can you show us what syntax are you trying?<br>
</div>Sure, I was just speculating it's known or trivial.<br>
<br>
Works:<br>
$items: LinkedList (size > 1) from collect ( Model ( ) from<br>
spatialIndex.query(...) )<br>
<br>
Fails:<br>
<br>
$items: LinkedList (size > 1) from collect ( Model ( ) from<br>
>object.getOriginal(null) in spatialIndex.query(...)< )<br>
<br>
The angle brackets aren't typed, they just mark what's intended as mvel.<br>
<div><div></div><div class="h5"><br>
><br>
> []s<br>
> Edson<br>
><br>
> 2009/8/5 Simon Thum <<a href="mailto:simon.thum@gmx.de">simon.thum@gmx.de</a>><br>
><br>
>> Hi all,<br>
>><br>
>> I've stumbled on some mvel integration issues in 5.0.1. I'm using drools<br>
>> to do, among others, spatial reasoning. At insertion time I maintain a<br>
>> specialized index, which can be queried later using [collect] from. This<br>
>> works fine in general.<br>
>><br>
>> However, as soon as I use the mvel 2 projections a.k.a. 'in' keyword,<br>
>> hell breaks loose. 'in' is described here:<br>
>> <a href="http://mvel.codehaus.org/MVEL+2.0+Projections+and+Folds" target="_blank">http://mvel.codehaus.org/MVEL+2.0+Projections+and+Folds</a><br>
>><br>
>> But I only seem to get syntax errors. If it is possible, to somehow<br>
>> escape keywords or explicitly pipe through the mvel part, please let me<br>
>> know!<br>
>><br>
>> Needless to say, this feature would be great to have since my object<br>
>> model is mainly fixed and 'is' allows me to compensate that. Worse, I'd<br>
>> need to assert objects I don't want to assert to work around.<br>
>><br>
>> I tried parenthesizing, only to discover that<br>
>> ... from valid_stmt<br>
>><br>
>> is fine, but<br>
>><br>
>> ... from (valid_stmt)<br>
>><br>
>> won't work either. Error 101, reason unknown, but it doesn't even make<br>
>> it through the parser.<br>
>><br>
>> I'd really appreciate to be given an idea why what I did went wrong.<br>
>> Googling around didn't get me too far.<br>
>><br>
>> Cheers,<br>
>><br>
>> Simon<br>
>> _______________________________________________<br>
>> rules-users mailing list<br>
>> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>><br>
><br>
><br>
><br>
><br>
</div></div>> ------------------------------------------------------------------------<br>
<div><div></div><div class="h5">><br>
> _______________________________________________<br>
> rules-users mailing list<br>
> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>