<div>Hi Felipe,</div><div><br></div><div>thank you for bearing with me.</div><div><br></div><div>actually I put an eval() there just to have something as simple as possible(but couldn&#39;t be sure it it worked). </div><div>
<br></div><div>I actually found a hello world example which works fine without being template and which I will now try to transform it into template form. I suspect I&#39;m not passing parameter correctly, somehow.</div><div>
<br></div><div>I will unfortunately be away for the next 10 days, so will revert only later and hopefully on a better example than my original.</div><div><br></div><div>Thanks. Stefan</div><div><br></div><div class="gmail_quote">
2010/4/27 Felipe Piccolini <span dir="ltr">&lt;<a href="mailto:felipe.piccolini@gmail.com">felipe.piccolini@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Im not sure if you can find a complete standalone example for this, but I think your problem now is with eval().<br><br>Can you copy your stackTrace here?<br><br>I think you can not do eval( literal == literal),<br>but you could make a function to test that if you wanna use eval and give the function the value of @{symbol}<br>

<br><br><div class="gmail_quote">2010/4/27 Stefan Marconi <span dir="ltr">&lt;<a href="mailto:stefan.marconi@gmail.com" target="_blank">stefan.marconi@gmail.com</a>&gt;</span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">

Hi Felipe,<div><br></div><div>thank you for your reply. I have now added the extra quotes but to no avail. I still get the same errors.</div><div><br></div><div>Is there somewhere a stand-alone example with the compile instructions to check that everything works? I have the impression that I&#39;m having troubles with the whole eclipse config and plugin.</div>


<div><br></div><div>Thanks! Stefan</div><div><br></div><div><br></div><div><div class="gmail_quote">2010/4/26 Felipe Piccolini <span dir="ltr">&lt;<a href="mailto:felipe.piccolini@gmail.com" target="_blank">felipe.piccolini@gmail.com</a>&gt;</span><div>

<div></div><div><br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Using template you will see that the @{} is replaced &quot;just as is&quot; from the data (for example from a spreadsheet), so<br>


if you have a value in the example will be replaced as text in the rule and you will have something like this:<br>
<br>if @{symbol} == &quot;THE_SYMBOL&quot;<br><br>==&gt;<br><br><div>rule &quot;A stand alone rule THE_SYMBOL&quot;</div><div><span style="white-space:pre">        </span>dialect &quot;mvel&quot;</div><div><span style="white-space:pre">        </span>when</div>




<div><span style="white-space:pre">                </span>eval(THE_SYMBOL == &quot;AAA&quot;)</div><div><span style="white-space:pre">        </span>then </div><div><span style="white-space:pre">                </span>System.out.println(&quot;this symbol is&quot; + THE_SYMBOL)<span style="white-space:pre">        </span></div>




<div>end</div>----------<br><br>So as you can see, the variable is no more a variable in the generated rule, just text, so if you wanna use it as a string, you should add double-quote<br>(&quot;)<br><br>your rule template should be something like this:<div>


<br>
<br><div>rule &quot;A stand alone rule @{symbol}&quot;</div><div><span style="white-space:pre">        </span>dialect &quot;mvel&quot;</div><div><span style="white-space:pre">        </span>when</div>
<div><span style="white-space:pre">                </span>eval(&quot;@{symbol}&quot; == &quot;AAA&quot;)</div><div><span style="white-space:pre">        </span>then </div><div><span style="white-space:pre">                </span>System.out.println(&quot;this symbol is&quot; +
 &quot;@{symbol}&quot;)<span style="white-space:pre">        </span></div>
<div>end</div><br><br><br><br></div><div class="gmail_quote">2010/4/22 Stefan Marconi <span dir="ltr">&lt;<a href="mailto:stefan.marconi@gmail.com" target="_blank">stefan.marconi@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">


<div><div></div><div>
<div>Hi,</div><div><br></div><div>just starting using drools and need to use templates but having error messages (described in comments in the code below). </div><div>I checked the meaning of the error messages but still can&#39;t figure it out.</div>




<div>I modified an simple rule according to the template section of the drools manual: btw I use the eclipse with the drools-core plugin.</div><div><br></div><div>Thanks for your help. Stefan</div><div><br></div>
<div><div>template header</div><div>symbol</div><div><br></div><div>package com.test.processor; # [ERR 102] Line 4:26 mismatched input &#39;;&#39; expecting &#39;identifier&#39; in template header</div><div>template &quot;test&quot;</div>




<div>rule &quot;A stand alone rule @{symbol}&quot;</div><div><span style="white-space:pre">        </span>dialect &quot;mvel&quot;</div><div><span style="white-space:pre">        </span>when</div>
<div><span style="white-space:pre">                </span>eval(@{symbol} == &quot;AAA&quot;)</div><div><span style="white-space:pre">        </span>then </div><div><span style="white-space:pre">                </span>System.out.println(&quot;this symbol is&quot; + @{symbol})<span style="white-space:pre">        </span></div>




<div>end</div><div>end template # Multiple markers at this line</div><div># - [ERR 103] Line 13:0 rule &#39;rule_key&#39; failed predicate: {(validateIdentifierKey(DroolsSoftKeywords.RULE))}? in rule</div><div># - [ERR 101] Line 13:4 no viable alternative at input &#39;template&#39; in rule end</div>




<div><br></div></div>
<br></div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br>-----------------------------<br>Felipe Piccolini<br><a href="mailto:felipe.piccolini@gmail.com" target="_blank">felipe.piccolini@gmail.com</a><br>



</font><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div></div></div><div><div></div><div class="h5"><br><br clear="all"><br>-- <br>-----------------------------<br>Felipe Piccolini<br><a href="mailto:felipe.piccolini@gmail.com" target="_blank">felipe.piccolini@gmail.com</a><br>

</div></div><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></blockquote></div><br>