Hi.<br>I&#39;m wondering if somebody could tell me if what I&#39;m doing is efficient or not.<br><br>Having written a number of rules we found that we were duplicating a number of constants, and if any of the &quot;constants&quot; (we later found out they are more like variants !!) it meant changing them in a number of places.
<br><br>What we came up with was to use a spreadsheet with three columns, variable name, a string value and a numeric value. We then used a little VB to produce an XML document, and via JAXB load the XML in as Java classes and assert the data into working memory.
<br><br>So we have a Class something like :-<br><br>public class ConstantValueType {<br><br>&nbsp;&nbsp;&nbsp; protected String varName;<br>&nbsp;&nbsp;&nbsp; protected int intVal;<br>&nbsp;&nbsp;&nbsp; protected String stringVal;<br><br>&nbsp;...........<br>}<br><br>Then within our rules we doing
<br><br>rule &quot;Exclusions 1&quot;<br>salience 500<br>when<br>&nbsp;&nbsp;&nbsp; ConstantValueType(varName == &quot;MaxProposerAge&quot;,$maxProposerAge : intVal&nbsp; )<br>&nbsp;&nbsp;&nbsp; $res : ResultData(schemeCode == &quot;TE&quot;)<br>&nbsp;&nbsp;&nbsp; $pr : Proposer($age : age &gt; $maxProposerAge )
<br>then<br>&nbsp;&nbsp;&nbsp; System.out.println(&quot;**** Not flexing because proposer age &gt;= &quot;+($maxProposerAge+1));<br>&nbsp;&nbsp;&nbsp; retract($res);<br>end<br><br>What I&#39;m wondering is because I&#39;m&nbsp; doing a ?join? &nbsp;&nbsp;&nbsp; pr : Proposer($age : age &gt; $maxProposerAge ) presumably this is similar to an eval and as such the rules engine is having to evaluate this each time rather than having the information ready to hand each time the rule is evaluated?
<br><br>If this is <span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;">inefficient&nbsp;<span style=""></span></span>is there another way of achieving this? We&#39;re currently working with 3.0.6<br><br>As it stands the rules engine is flying, but it would be nice to know if what I&#39;m doing could be done better
<br><br>Thanks in advance<br><br>Simon<br>