<br>&nbsp;&nbsp;&nbsp; What I would do in your case is to have 2+ rules. One rule calculates the value, and the other(s) rule(s) will reason over the calculated value.<br>&nbsp;&nbsp;&nbsp; Example:<br><br>rule &quot;Calculates Memory Usage&quot;<br>when
<br>&nbsp;&nbsp;&nbsp;&nbsp; $mpw: Resource( type==&quot;MemoryInfo&quot;, attributes.Percent == null, $phys:attributes.PhysicalUsed, $tot: attributes.TotalPhysical )<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp; $mpw.setAttribute( &quot;Percent&quot;, ((Double)$phys).doubleValue() / ((Double)$tot).doubleValue());
<br>&nbsp;&nbsp;&nbsp;&nbsp; update( $mpw );<br>end<br><br>rule &quot;High Average Usage&quot;<br>when <br>&nbsp;&nbsp;&nbsp; Resource( type==&quot;MemoryInfo&quot;, attributes.Percent &gt; .95 )<br>then<br>&nbsp; &nbsp; // do something<br>end<br>&nbsp;<br>rule &quot;Medium Average Usage&quot;
<br>
when <br>
&nbsp;&nbsp;&nbsp; Resource( type==&quot;MemoryInfo&quot;, attributes.Percent &gt; .50 &amp;&amp; &lt;= .95 )<br>
then<br>
&nbsp; &nbsp; // do something<br>
end<br>
&nbsp;<br>&nbsp;&nbsp;&nbsp; Hope it helps...<br><br>&nbsp;&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><br><br><div><span class="gmail_quote">2007/8/27, cfili &lt;<a href="mailto:cfilippelli@cerner.com">cfilippelli@cerner.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Sure... basically using a map called &quot;attributes&quot; to retrieve specific<br>attributes on a resource.&nbsp;&nbsp;Currently I am simply printing the value from the<br>eval, but I would like to be able to store it.<br><br>
rule &quot;High Memory 95%&quot;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$mpw : Resource(type == &quot;MemoryInfo&quot;, $physUsed :<br>attributes[&quot;PhysicalUsed&quot;], $totalPhys : attributes[&quot;TotalPhysical&quot;])
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eval((((Double)$physUsed).doubleValue() /<br>((Double)$totalPhys).doubleValue()) &gt; 0.95)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&quot; Percent Used: &quot; + ((Double)$physUsed).doubleValue() /
<br>((Double)$totalPhys).doubleValue());<br>end<br>--<br>View this message in context: <a href="http://www.nabble.com/Storing-temp-results-in-eval-block-tf4225783.html#a12354084">http://www.nabble.com/Storing-temp-results-in-eval-block-tf4225783.html#a12354084
</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli
<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>