The "package" declaration must be first. <br><br>You don't have to insert the "dialect" 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"><<a href="mailto:zhaoh@hpnl.ac.cn">zhaoh@hpnl.ac.cn</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;">
<p> hello,everyone! I wrote a rule with Drools, I compile the program and get the errors as follows: </p>
<p><br>[3,0]: [ERR 103] Line 3:0 rule 'rule_key' failed predicate: {(validateIdentifierKey(DroolsSoftKeywords.RULE))}? in rule<br>[3,9]: [ERR 101] Line 3:9 no viable alternative at input 'com' in rule package<br>
[7,0]: [ERR 101] Line 7:0 no viable alternative at input 'import' in rule package in rule sample </p>
<p><br>I don't know how it happened, looking forward to your reply! thank you !!! </p>
<p> </p>
<p>PS: My rules are here:</p>
<p> dialect "mvel"<br>package com.sample</p>
<p>import com.sample.Server;</p>
<p><br>rule "system will execute 'tc' command"<br> <br> when<br> eval(Server.Message>8388608)<br> then <br> System.out.println("The network is so crowd that it needs repairing.");<br>
Runtime.getRuntime().exec("tc");#give the authority and execute the "tc" command<br>end</p>
<p> </p>
<p>rule "caution"<br> when <br> eval(Server.Message==8388608)<br> then <br> System.out.println("caution!The network maybe will get blocked very soon.");<br>end </p>
<p> </p>
<p>rule "fluent network"<br> when<br> eval(Server.Message<8388608)#conditions<br> then <br> System.out.println("the current network is very good");#actions<br>end</p>
<p> </p>
<p> </p>
<p> </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>