5 Aug 21:57
Re: [rules-dev] [rules-users] MVEL parsing / keyword conflict
Edson Tirelli <tirelli <at> post.com>
2009-08-05 19:57:49 GMT
2009-08-05 19:57:49 GMT
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":
$items: LinkedList (size > 1) from collect ( Model ( ) from return( object.getOriginal(null) in spatialIndex.query(...) ) )
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.
[]s
Edson
2009/8/5 Simon Thum <simon.thum <at> gmx.de>
Edson Tirelli wrote:Sure, I was just speculating it's known or trivial.
> Simon,
>
> Can you show us what syntax are you trying?
Works:
$items: LinkedList (size > 1) from collect ( Model ( ) from
spatialIndex.query(...) )
Fails:
$items: LinkedList (size > 1) from collect ( Model ( ) from
>object.getOriginal(null) in spatialIndex.query(...)< )
The angle brackets aren't typed, they just mark what's intended as mvel.> ------------------------------------------------------------------------
>
> []s
> Edson
>
> 2009/8/5 Simon Thum <simon.thum <at> gmx.de>
>
>> Hi all,
>>
>> I've stumbled on some mvel integration issues in 5.0.1. I'm using drools
>> to do, among others, spatial reasoning. At insertion time I maintain a
>> specialized index, which can be queried later using [collect] from. This
>> works fine in general.
>>
>> However, as soon as I use the mvel 2 projections a.k.a. 'in' keyword,
>> hell breaks loose. 'in' is described here:
>> http://mvel.codehaus.org/MVEL+2.0+Projections+and+Folds
>>
>> But I only seem to get syntax errors. If it is possible, to somehow
>> escape keywords or explicitly pipe through the mvel part, please let me
>> know!
>>
>> Needless to say, this feature would be great to have since my object
>> model is mainly fixed and 'is' allows me to compensate that. Worse, I'd
>> need to assert objects I don't want to assert to work around.
>>
>> I tried parenthesizing, only to discover that
>> ... from valid_stmt
>>
>> is fine, but
>>
>> ... from (valid_stmt)
>>
>> won't work either. Error 101, reason unknown, but it doesn't even make
>> it through the parser.
>>
>> I'd really appreciate to be given an idea why what I did went wrong.
>> Googling around didn't get me too far.
>>
>> Cheers,
>>
>> Simon
>> _______________________________________________
>> 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
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat <at> www.jboss.com
_______________________________________________ rules-dev mailing list rules-dev <at> lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-dev
RSS Feed