The &quot;package&quot; declaration must be first. <br><br>You don&#39;t have to insert the &quot;dialect&quot; attribute into each rule.<br><br>Please consult the manual when programming.<br><br>-W<br><br><br><br><br><br>
<div class="gmail_quote">2011/4/15 ÕÔ»Û <span dir="ltr">&lt;<a href="mailto:zhaoh@hpnl.ac.cn">zhaoh@hpnl.ac.cn</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<p>&nbsp;hello,everyone! I wrote a rule with Drools, I&nbsp;compile&nbsp;the&nbsp;program&nbsp;and&nbsp;get&nbsp;the&nbsp;errors&nbsp;as&nbsp;follows:&nbsp;</p>
<p><br>[3,0]: [ERR 103] Line 3:0 rule &#39;rule_key&#39; failed predicate: {(validateIdentifierKey(DroolsSoftKeywords.RULE))}? in rule<br>[3,9]: [ERR 101] Line 3:9 no viable alternative at input &#39;com&#39; in rule package<br>
[7,0]: [ERR 101] Line 7:0 no viable alternative at input &#39;import&#39; in rule package in rule sample&nbsp; </p>
<p><br>I&nbsp;don&#39;t&nbsp;know&nbsp;how&nbsp;it&nbsp;happened,&nbsp;looking&nbsp;forward&nbsp;to&nbsp;your&nbsp;reply!&nbsp;thank&nbsp;you&nbsp;!!! </p>
<p>&nbsp;</p>
<p>PS: My rules are here:</p>
<p>&nbsp;dialect &quot;mvel&quot;<br>package&nbsp; com.sample</p>
<p>import com.sample.Server;</p>
<p><br>rule &quot;system will execute &#39;tc&#39; command&quot;<br>&nbsp;&nbsp; <br>&nbsp;when<br>&nbsp;&nbsp;&nbsp; eval(Server.Message&gt;8388608)<br>&nbsp;then <br>&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&quot;The network is so crowd that it needs repairing.&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;Runtime.getRuntime().exec(&quot;tc&quot;);#give the authority and execute the &quot;tc&quot; command<br>end</p>
<p>&nbsp;</p>
<p>rule &quot;caution&quot;<br>&nbsp;&nbsp;&nbsp; when <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eval(Server.Message==8388608)<br>&nbsp;&nbsp;&nbsp; then <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&quot;caution!The network maybe will get blocked very soon.&quot;);<br>end </p>
<p>&nbsp;</p>
<p>rule &quot;fluent network&quot;<br>&nbsp;&nbsp;when<br>&nbsp;&nbsp;eval(Server.Message&lt;8388608)#conditions<br>&nbsp;then <br>&nbsp;&nbsp;System.out.println(&quot;the current network is very good&quot;);#actions<br>end</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p> <br><br><br><br>

<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>