A better approach would be to use:-<br><br><div style="font-family: courier new,monospace;">rule &quot;system will execute &#39;tc&#39; command&quot;<br>&nbsp;when<br>&nbsp;&nbsp;&nbsp; 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;Runtime.getRuntime().exec(&quot;tc&quot;);#execute the &quot;tc&quot; command<br>end</div>
<br>This assumes you insert Server facts into working memory and they have a &quot;getMessage&quot; property.<br><br>Normally you&#39;d use eval when you are unable to leverage DRL. Their use is normally discouraged. Also, your usage is incorrect; please read the documentation.<br>
<br>With kind regards,<br><br>Mike<br><br><div class="gmail_quote">2011/4/12 ÕÔ»Û <span dir="ltr">&lt;<a href="mailto:zhaoh@hpnl.ac.cn">zhaoh@hpnl.ac.cn</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>hello,everyone!I wrote a rule with Drools,but the error told me that the field Server.Message is not visible, I can&#39;t find how it happens. Please help me, I am almost exhausted with it. thank you.</div>
<div>the rules&nbsp;are as follows:</div>
<div>&nbsp;</div>
<div>package com.sample</div>
<div>import com.sample.Server;</div>
<div>&nbsp;</div>
<div>rule &quot;system will execute &#39;tc&#39; command&quot;<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;Runtime.getRuntime().exec(&quot;tc&quot;);#execute the &quot;tc&quot; command<br>
end</div>
<div>&nbsp;</div>
<div>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 </div>
<div>&nbsp;</div>
<div>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</div></div><br></div> <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>