Ah, that was an oversight. After fixing that, I now get ...
mismatched input '"type"' expecting ']' in rule "filter
content if
advertisement" in pattern properties
Is something wrong with this mvel syntax?
properties["type"]=="ad" from content
Pritam wrote:
While executing the following rule,
dialect "mvel"
import xxx.*
import java.util.*
global HashMap filter
rule "filter content if advertisement"
when
point: Point(page == "home", region ="center-content")
content: Content(id=="adslot")
properties["type"]=="ad" from content
then
filter.put(content.id, true);
end
I get the following error:
[ERR 101] Line 16:46 no viable alternative at input 'EQUALS' in rule
"filter content if advertisement" in pattern Point[18,16]: [ERR 102] Line
18:16 mismatched input '"type"' expecting ']' in rule
"filter content if
advertisement" in pattern properties
The documentation explains that this is the most common error but I still
struggle to understand the correct grammar for writing rules. Can anyone
point me to a good resource (I even read the book "Drools 5" by Packt) for
writing the following rule in a drl format?
" If a Point has a page, "home" and region, "center-content" and
the
Content id is "adslot" with a property, type as "ad" then filter the
Content (using a global map and passing a boolean flag)
Thanks
--
View this message in context:
http://n3.nabble.com/Understanding-no-viable-alternative-errors-tp119375p...
Sent from the Drools - User mailing list archive at
Nabble.com.