<br>   root of your project &quot;classpath&quot;, not root of your project.<br><br>   []s<br>   Edson<br><br><div class="gmail_quote">2009/7/15 Asif Iqbal <span dir="ltr">&lt;<a href="mailto:Asif.Iqbal@infor.com">Asif.Iqbal@infor.com</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;">









<div link="blue" vlink="blue" lang="EN-US">

<div>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Hi Edson,</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">I have gone away and tried the properties
method of adding the customEvaluator, which worked fine for the code.  But my
IDE still does not pick it up. Any ideas?</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Do I need to place it in a META-INF folder
in the root of the project?</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">I have the following in the </span></font>drools.packagebuilder.conf
file.<font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"></span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p style=""><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">drools.evaluator.custom=com.infor.audit.bpr.component.validation.impl.drools.CustomComparableEvaluatorsDefinition</span></font></p>


<p style=""><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> </span></font></p>

<p style=""><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">thanks..</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<div>

<div style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">

<hr align="center" size="2" width="100%">

</span></font></div>

<p><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">
<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] <b><span style="font-weight: bold;">On
Behalf Of </span></b>Edson Tirelli<div class="im"><br>
<b><span style="font-weight: bold;">Sent:</span></b> 15 July 2009 14:57<br>
</div><div><div></div><div class="h5"><b><span style="font-weight: bold;">To:</span></b> Rules Users List<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] Getting
hold of the Evaluator Registry</div></div></span></font></p>

</div><div><div></div><div class="h5">

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>

<p style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
   Yes, you are in the right track, and I understand this is a bit
confusing at first. One more reason for people to go to the October Rules Fest
2009 where I will give a presentation on all the ways to extend the engine to
solve specific problems. It will be interesting I hope (last year was awesome)
and even Charles Forgy will be there doing a presentation on Parallel Rete. :)<br>
<br>
    Meanwhile I will write a tutorial on this, but just to help
you there, your approach is correct, except that you don&#39;t need to setup the
option for each operator. It works like this:<br>
<br>
* One EvaluatorDefinition class implements support to one or more evaluators,
defined by the method public String[] getEvaluatorIds().<br>
<br>
* All you need to do, then, is wire you class once and the engine will pick-up
all the IDs supported by that class. When you have your class wired, you give
it a unique string identifier, so that if you ever need to replace it, or
remove it, you will use that id. Sometimes we use the operator as the ID, but
usually it is something that reminds you of the kind of evaluators that class
define. For instance, drools registers the ComparableEvaluatorsDefinition in
this way:<br>
<br>
drools.evaluator.comparable =
org.drools.base.evaluators.ComparableEvaluatorsDefinition<br>
<br>
  So in this case, &quot;comparable&quot; is the identifier. Finally, from
my previous e-mail you will see that the reason that the eclipse IDE is still
giving you errors is that you are using the API to configure the evaluators.
Just move the configuration to the configuration file and the IDE will pick it
up.<br>
<br>
   []s<br>
   Edson<br>
<br>
<br>
</span></font></p>

<div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">2009/7/15 Asif Iqbal &lt;<a href="mailto:Asif.Iqbal@infor.com" target="_blank">Asif.Iqbal@infor.com</a>&gt;</span></font></p>

<div link="blue" vlink="blue">

<div>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Edson,</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">What I have done so far is created a
CustomComparableEvaluatorsDefinition, which is exactly the same as the default
ComparableEvaluatorsDefinition apart form having support for strings, which I
have done by creating StringGreaterOrEqualEvaluators and added that in my
custom class, using the addEvaluatorFunction :-</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">           
addEvaluator( ValueType.SHORT_TYPE,        
Operator.GREATER,            
ShortGreaterEvaluator.INSTANCE );</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">           
addEvaluator(
ValueType.SHORT_TYPE,        
Operator.GREATER_OR_EQUAL,   
ShortGreaterOrEqualEvaluator.INSTANCE );</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">           
addEvaluator( ValueType.PSHORT_TYPE,       
Operator.LESS,               
ShortLessEvaluator.INSTANCE );</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">           
addEvaluator( ValueType.PSHORT_TYPE,   
    Operator.LESS_OR_EQUAL,      
ShortLessOrEqualEvaluator.INSTANCE );</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">           
addEvaluator( ValueType.PSHORT_TYPE,       
Operator.GREATER,            
ShortGreaterEvaluator.INSTANCE );</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">           
addEvaluator( ValueType.PSHORT_TYPE,       
Operator.GREATER_OR_EQUAL,   
ShortGreaterOrEqualEvaluator.INSTANCE );</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">           
//Custom additions</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">           
addEvaluator( ValueType.STRING_TYPE,       
Operator.LESS,               
StringLessEvaluator.INSTANCE );</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">           
addEvaluator( ValueType.STRING_TYPE,       
Operator.LESS_OR_EQUAL,      
StringLessOrEqualEvaluator.INSTANCE );</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">           
addEvaluator( ValueType.STRING_TYPE,       
Operator.GREATER,            
StringGreaterEvaluator.INSTANCE );</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">           
addEvaluator( ValueType.STRING_TYPE,       
Operator.GREATER_OR_EQUAL,  
 StringGreaterOrEqualEvaluator.INSTANCE );</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Now Im am trying to wire it, with the following.. </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="#333399" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(51, 51, 153);">                       
CustomComparableEvaluatorsDefinition MyCustomComparable custom = <b><span style="font-weight: bold;">new</span></b> CustomComparableEvaluatorsDefinition();</span></font></p>

<p><font color="#333399" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(51, 51, 153);">                       
KnowledgeBuilderConfiguration config = KnowledgeBuilderFactory.<i><span style="font-style: italic;">newKnowledgeBuilderConfiguration</span></i>();</span></font></p>

<p><font color="#333399" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(51, 51, 153);">                       
EvaluatorOption option = EvaluatorOption.<i><span style="font-style: italic;">get</span></i>(<u>Operator.<i><span style="font-style: italic;">LESS</span></i>.toString()</u>, custom);</span></font></p>

<p><font color="#333399" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(51, 51, 153);">                       
EvaluatorOption option2 = EvaluatorOption.<i><span style="font-style: italic;">get</span></i>(<u>Operator.<i><span style="font-style: italic;">LESS_OR_EQUAL</span></i>.toString()</u>, custom);</span></font></p>

<p><font color="#333399" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(51, 51, 153);">                       
EvaluatorOption option3 = EvaluatorOption.<i><span style="font-style: italic;">get</span></i>(<u>Operator.<i><span style="font-style: italic;">GREATER</span></i>.toString()</u>, custom);</span></font></p>

<p><font color="#333399" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(51, 51, 153);">                       
EvaluatorOption option4 = EvaluatorOption.<i><span style="font-style: italic;">get</span></i>(<u>Operator.<i><span style="font-style: italic;">GREATER_OR_EQUAL</span></i>.toString()</u>, custom);</span></font></p>

<p><font color="#333399" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(51, 51, 153);">                       
</span></font></p>

<p><font color="#333399" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(51, 51, 153);">                       
config.setOption(option);</span></font></p>

<p><font color="#333399" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(51, 51, 153);">                       
config.setOption(option2);</span></font></p>

<p><font color="#333399" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(51, 51, 153);">                       
config.setOption(option3);</span></font></p>

<p><font color="#333399" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(51, 51, 153);">                       
config.setOption(option4);</span></font></p>

<p><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Firstly is this the correct approach?....</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">The problem im having is that in my drl files still flag
errors, when I do “test” &gt; “test2” , am I missing something?</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Regards</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<div>

<div style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">

<hr align="center" size="2" width="100%">

</span></font></div>

<p><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>]
<b><span style="font-weight: bold;">On Behalf Of </span></b>Asif Iqbal<br>
<b><span style="font-weight: bold;">Sent:</span></b> 15 July 2009 08:20<br>
<b><span style="font-weight: bold;">To:</span></b> Rules Users List<br>
<b><span style="font-weight: bold;">Subject:</span></b> RE: [rules-users] Getting
hold of the Evaluator Registry</span></font></p>

</div>

<div>

<div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Edson,</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Thanks for your replies they have really helped. </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p style="margin-left: 0.5in; text-indent: -0.25in;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">1)</span></font><font color="navy" size="1"><span style="font-size-adjust: none; font-stretch: normal;"><span style="font-size: 7pt; color: navy;">       </span></span></font><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">I am still not sure about creating a new operator, since the
‘&gt;=’ operator already exists it just does not cater for strings, which I
want to add. So would creating a new operator cause the existing one to be
overrriden when added to the registry?  </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p style="margin-left: 0.5in; text-indent: -0.25in;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">2)</span></font><font color="navy" size="1"><span style="font-size-adjust: none; font-stretch: normal;"><span style="font-size: 7pt; color: navy;">       </span></span></font><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Having looked at the examples and tests you emailed, I am still
unsure how to actually wire in the changes, say for example I have replaced the
existing ‘&gt;=’ evaluator or created a new evaluator so that ‘&gt;=’  now
handles strings. When writing rules will the engine pick this up?.. or do I
need to create a new jar by building?.. or do I need to update a configuration
file?... im just not sure…</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p style="margin-left: 0.5in; text-indent: -0.25in;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">3)</span></font><font color="navy" size="1"><span style="font-size-adjust: none; font-stretch: normal;"><span style="font-size: 7pt; color: navy;">       </span></span></font><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Wouldn’t the following also add the evaluator definition by
replacing the existing one.. </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                 
<u>PackageBuilderConfiguration</u> pkgb = </span></font><b><u><font color="#7f0055" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">new</span></font></u></b><u><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> PackageBuilderConfiguration()</span></font></u><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;  
            </span></font></p>

<p><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                 
<u>pkgb.getEvaluatorRegistry()</u>.<u>addEvaluatorDefinition</u>(</span></font><b><font color="#7f0055" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">new </span></font></b><font color="black" face="Courier New" size="2"><span><span style="background: silver none repeat scroll 0% 0%; font-size: 10pt; font-family: &quot;Courier New&quot;; color: black; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">ComparableEvaluatorsDefinition</span></span></font><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">());</span></font></p>


<p><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                 
<u><span><span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">PackageBuilder</span></span></u> builder = </span></font><b><u><font color="#7f0055" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">new</span></font></u></b><u><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> <span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"><span>PackageBuilder</span></span>(pkgb)</span></font></u><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></font></p>


<p><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font></p>

<p><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                 
<u>builder.addPackageFromDrl(source)</u>;</span></font></p>

<p><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                 
<u>Package</u> pkg = <u>builder.getPackage()</u>;</span></font></p>

<p><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                 
</span></font><font color="#3f7f5f" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 95);">// Add the
package to a <u>rulebase</u> (deploy the rule package).</span></font></p>

<p><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                 
</span></font><font color="#0000c0" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">rules</span></font><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> = <u>RuleBaseFactory.<i><span style="font-style: italic;">newRuleBase</span></i>()</u>;</span></font></p>


<p><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                 
</span></font><u><font color="#0000c0" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">rules</span></font></u><u><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.addPackage(pkg)</span></font></u><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></font></p>


<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Thanks for your help…</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<div>

<div style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">

<hr align="center" size="2" width="100%">

</span></font></div>

<p><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>]
<b><span style="font-weight: bold;">On Behalf Of </span></b>Edson Tirelli<br>
<b><span style="font-weight: bold;">Sent:</span></b> 14 July 2009 23:05<br>
<b><span style="font-weight: bold;">To:</span></b> Rules Users List<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] Getting
hold of the Evaluator Registry</span></font></p>

</div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>

<p style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
   I am working in one example of drools features where I implement a
custom evaluator here:<br>
<br>
<a href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/contrib/lotrc/src/main/java/org/drools/examples/lotrc/evaluators/IsAdjacentToEvaluatorDefinition.java" target="_blank">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/contrib/lotrc/src/main/java/org/drools/examples/lotrc/evaluators/IsAdjacentToEvaluatorDefinition.java</a><br>

<br>
   I use the configuration file instead of API in the example:<br>
<br>
<a href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/contrib/lotrc/src/main/resources/META-INF/drools.packagebuilder.conf" target="_blank">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/contrib/lotrc/src/main/resources/META-INF/drools.packagebuilder.conf</a><br>

<br>
   []s<br>
   Edson</span></font></p>

<div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">2009/7/14
Edson Tirelli &lt;<a href="mailto:tirelli@post.com" target="_blank">tirelli@post.com</a>&gt;</span></font></p>

<p style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
   Asif,<br>
<br>
   My recommendation is create a new operator for you instead of
overriding existing ones. Although if you really want to replace the existing
ones, setting the property or calling the API to register a new operator will
override the default.<br>
<br>
   See:<br>
<br>
<a href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/builder/KnowledgeBuilderConfigurationTest.java" target="_blank">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/builder/KnowledgeBuilderConfigurationTest.java</a><br>

<br>
   Test method:<br>
<br>
testEvaluatorConfiguration()<br>
<br>
   []s<br>
   Edson</span></font></p>

<div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">2009/7/14
Asif Iqbal &lt;<a href="mailto:Asif.Iqbal@infor.com" target="_blank">Asif.Iqbal@infor.com</a>&gt;</span></font></p>

<div>

<div>

<div link="blue" vlink="purple">

<div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB">Hi,</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB"> </span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB">What
I need to do is modify one of the evaluator classes specifically ‘&lt;=’, so
that it can handle strings. Now I know I need to create a class similar to
ComparableEvaluatorDefinition. But what I want to do is replace the existing
one in the evaluator registry with my implementation which will include the
additional String capability.</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB"> </span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB">From
my understanding that should be all that is required. Unless im missing
something… now all I need to know is how do I get hold of the evaluator
registry?</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB"> </span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB">Cheers</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB"> </span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB">I</span></font></p>

</div>

</div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>

</div>

</div>

<p style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></span></font></p>

</div>

<p><font color="#888888" face="Times New Roman" size="3"><span style="font-size: 12pt; color: rgb(136, 136, 136);"><br>
<br clear="all">
<br>
-- <br>
 Edson Tirelli<br>
 JBoss Drools Core Development<br>
 JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a></span></font></p>

</div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
<br clear="all">
<br>
-- <br>
 Edson Tirelli<br>
 JBoss Drools Core Development<br>
 JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a></span></font></p>

</div>

</div>

</div>

</div>

<p style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></span></font></p>

</div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
<br clear="all">
<br>
-- <br>
 Edson Tirelli<br>
 JBoss Drools Core Development<br>
 JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a></span></font></p>

</div></div></div>

</div>


<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><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>