[rules-users] Can "From" reason over primitive arrays?

Henry Canterburry canterburry at gmail.com
Wed Jan 16 01:27:50 EST 2008


I am trying to pattern match on a primitive array such as String[] or 
SomeObject[]. The documentation only mentions collections in the section 
about From.

Would a pattern match syntax such as...

rule "My rule"
    when
       $source : SourceObject()
       $myObject : MyObject() from $source.returnsAnArrayProperty
    then
       ....

..be correct? If not, how can capture and loop over every object in an 
array (not Collection)?

I have tried the above and I get a ClassCastException.

HC



More information about the rules-users mailing list