<br> The error simply means that your syntax is incorrect and the parser could not understand the character at line 16, character 46. In this case, you are using "=" instead of the correct "==":<br><br>
pointId: Point(page == "home", region == "center-content")<br>
<br> Also, remember that constraints can only exist inside a pattern, so your "properties" constraint must go inside the proper pattern that I guess is "Content"<br><br> content: Content(id=="adslot", properties["type"]=="ad" )<br>
<br> []s<br> Edson<br><br><br><div class="gmail_quote">2010/1/13 Pritam <span dir="ltr"><<a href="mailto:infinity2heaven@gmail.com">infinity2heaven@gmail.com</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;">
<br>
While executing the following rule,<br>
<br>
rule "home dummy"<br>
when<br>
pointId: Point(page == "home", region ="center-content")<br>
content: Content(id=="adslot")<br>
properties["type"]=="ad" from content<br>
then<br>
filter.put(<a href="http://content.id" target="_blank">content.id</a>, true);<br>
end<br>
<br>
I get the following error:<br>
[ERR 101] Line 16:46 no viable alternative at input 'EQUALS' in rule "home<br>
dummy" in pattern PointId[18,16]: [ERR 102] Line 18:16 mismatched input<br>
'"type"' expecting ']' in rule "home dummy" in pattern properties<br>
<br>
The documentation explains that this is the most common error but I still<br>
struggle to understand the correct grammar for writing rules. Can anyone<br>
point me to a good resource (I even read the book "drools 5) for writing the<br>
following rule in a drl format?<br>
<br>
" If a Point has a page, "home" and region, "center-content" and the Content<br>
id is "adslot" with a property, type as "ad" then filter the Content (using<br>
a global map and passing a boolean flag)<br>
<br>
Thanks<br>
<font color="#888888">--<br>
View this message in context: <a href="http://n3.nabble.com/Understanding-no-viable-alternative-errors-tp119375p119375.html" target="_blank">http://n3.nabble.com/Understanding-no-viable-alternative-errors-tp119375p119375.html</a><br>
Sent from the Drools - User mailing list archive at Nabble.com.<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>
</font></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>