<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Excellent, worked a treat&#8230;. Thank you&#8230;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

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

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

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Edson Tirelli<br>
<b><span style='font-weight:bold'>Sent:</span></b> 16 July 2009 14: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><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
&nbsp;&nbsp;&nbsp; There are several places that drools looks for configuration
files, including your home directory. Although, IMO it makes more sense to keep
it confined to the project itself. If you create a dir in your project, like:<br>
<br>
src/resources/META-INF<br>
<br>
&nbsp;&nbsp;&nbsp; And then configure the eclipse project to use the folde
&quot;src/resources&quot; as a source folder, it will pick it up.<br>
&nbsp; <br>
&nbsp;&nbsp;&nbsp; []s<br>
&nbsp;&nbsp;&nbsp; Edson<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>2009/7/16 Jaroslaw Kijanowski &lt;<a href="mailto:kijanowski@gmail.com">kijanowski@gmail.com</a>&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Linux, when I created my own accumulate functions, I had to put this<br>
file in my home directory to have it picked up by Eclipse.<br>
<br>
Cheers,<br>
&nbsp;Jarek<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
Edson Tirelli wrote:<br>
&gt;<br>
&gt; &nbsp; &nbsp;root of your project &quot;classpath&quot;, not root of your
project.<br>
&gt;<br>
&gt; &nbsp; &nbsp;[]s<br>
&gt; &nbsp; &nbsp;Edson<br>
&gt;<o:p></o:p></span></font></p>

</div>

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

<div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt;<br>
&gt; &nbsp; &nbsp; Hi Edson,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; I have gone away and tried the properties method of adding
the<br>
&gt; &nbsp; &nbsp; customEvaluator, which worked fine for the code. &nbsp;But
my IDE still<br>
&gt; &nbsp; &nbsp; does not pick it up. Any ideas?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Do I need to place it in a META-INF folder in the root of
the project?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; I have the following in the drools.packagebuilder.conf file.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp;
drools.evaluator.custom=com.infor.audit.bpr.component.validation.impl.drools.CustomComparableEvaluatorsDefinition<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; thanks..<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp;
------------------------------------------------------------------------<br>
&gt;<br>
&gt; &nbsp; &nbsp; *From:* <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
&gt; &nbsp; &nbsp; &lt;mailto:<a
href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;<br>
&gt; &nbsp; &nbsp; [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
&gt; &nbsp; &nbsp; &lt;mailto:<a
href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;]
*On Behalf Of *Edson<br>
&gt; &nbsp; &nbsp; Tirelli<br>
&gt;<br>
&gt; &nbsp; &nbsp; *Sent:* 15 July 2009 14:57<br>
&gt; &nbsp; &nbsp; *To:* Rules Users List<br>
&gt; &nbsp; &nbsp; *Subject:* Re: [rules-users] Getting hold of the Evaluator
Registry<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;Yes, you are in the right track, and I
understand this is a bit<br>
&gt; &nbsp; &nbsp; confusing at first. One more reason for people to go to the
October<br>
&gt; &nbsp; &nbsp; Rules Fest 2009 where I will give a presentation on all the
ways to<br>
&gt; &nbsp; &nbsp; extend the engine to solve specific problems. It will be
interesting<br>
&gt; &nbsp; &nbsp; I hope (last year was awesome) and even Charles Forgy will
be there<br>
&gt; &nbsp; &nbsp; doing a presentation on Parallel Rete. :)<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Meanwhile I will write a tutorial on this, but
just to help you<br>
&gt; &nbsp; &nbsp; there, your approach is correct, except that you don't need
to setup<br>
&gt; &nbsp; &nbsp; the option for each operator. It works like this:<br>
&gt;<br>
&gt; &nbsp; &nbsp; * One EvaluatorDefinition class implements support to one or
more<br>
&gt; &nbsp; &nbsp; evaluators, defined by the method public String[]
getEvaluatorIds().<br>
&gt;<br>
&gt; &nbsp; &nbsp; * All you need to do, then, is wire you class once and the
engine<br>
&gt; &nbsp; &nbsp; will pick-up all the IDs supported by that class. When you
have your<br>
&gt; &nbsp; &nbsp; class wired, you give it a unique string identifier, so that
if you<br>
&gt; &nbsp; &nbsp; ever need to replace it, or remove it, you will use that id.<br>
&gt; &nbsp; &nbsp; Sometimes we use the operator as the ID, but usually it is
something<br>
&gt; &nbsp; &nbsp; that reminds you of the kind of evaluators that class
define. For<br>
&gt; &nbsp; &nbsp; instance, drools registers the
ComparableEvaluatorsDefinition in<br>
&gt; &nbsp; &nbsp; this way:<br>
&gt;<br>
&gt; &nbsp; &nbsp; drools.evaluator.comparable =<br>
&gt; &nbsp; &nbsp; org.drools.base.evaluators.ComparableEvaluatorsDefinition<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; So in this case, &quot;comparable&quot; is the
identifier. Finally, from my<br>
&gt; &nbsp; &nbsp; previous e-mail you will see that the reason that the
eclipse IDE is<br>
&gt; &nbsp; &nbsp; still giving you errors is that you are using the API to
configure<br>
&gt; &nbsp; &nbsp; the evaluators. Just move the configuration to the
configuration<br>
&gt; &nbsp; &nbsp; file and the IDE will pick it up.<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;[]s<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;Edson<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; 2009/7/15 Asif Iqbal &lt;<a
href="mailto:Asif.Iqbal@infor.com">Asif.Iqbal@infor.com</a><o:p></o:p></span></font></p>

</div>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:Asif.Iqbal@infor.com">Asif.Iqbal@infor.com</a>&gt;&gt;<o:p></o:p></span></font></p>

<div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt;<br>
&gt; &nbsp; &nbsp; Edson,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; What I have done so far is created a<br>
&gt; &nbsp; &nbsp; CustomComparableEvaluatorsDefinition, which is exactly the
same as<br>
&gt; &nbsp; &nbsp; the default ComparableEvaluatorsDefinition apart form having
support<br>
&gt; &nbsp; &nbsp; for strings, which I have done by creating<br>
&gt; &nbsp; &nbsp; StringGreaterOrEqualEvaluators and added that in my custom
class,<br>
&gt; &nbsp; &nbsp; using the addEvaluatorFunction :-<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEvaluator(
ValueType.SHORT_TYPE,<br>
&gt; &nbsp; &nbsp; Operator.GREATER, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
ShortGreaterEvaluator.INSTANCE );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEvaluator(
ValueType.SHORT_TYPE,<br>
&gt; &nbsp; &nbsp; Operator.GREATER_OR_EQUAL, &nbsp;
&nbsp;ShortGreaterOrEqualEvaluator.INSTANCE );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEvaluator(
ValueType.PSHORT_TYPE,<br>
&gt; &nbsp; &nbsp; Operator.LESS, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;ShortLessEvaluator.INSTANCE );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEvaluator(
ValueType.PSHORT_TYPE,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Operator.LESS_OR_EQUAL, &nbsp; &nbsp; &nbsp;
ShortLessOrEqualEvaluator.INSTANCE );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEvaluator(
ValueType.PSHORT_TYPE,<br>
&gt; &nbsp; &nbsp; Operator.GREATER, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
ShortGreaterEvaluator.INSTANCE );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEvaluator(
ValueType.PSHORT_TYPE,<br>
&gt; &nbsp; &nbsp; Operator.GREATER_OR_EQUAL, &nbsp;
&nbsp;ShortGreaterOrEqualEvaluator.INSTANCE );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //Custom additions<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEvaluator(
ValueType.STRING_TYPE,<br>
&gt; &nbsp; &nbsp; Operator.LESS, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;StringLessEvaluator.INSTANCE );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEvaluator(
ValueType.STRING_TYPE,<br>
&gt; &nbsp; &nbsp; Operator.LESS_OR_EQUAL, &nbsp; &nbsp; &nbsp;
StringLessOrEqualEvaluator.INSTANCE );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEvaluator(
ValueType.STRING_TYPE,<br>
&gt; &nbsp; &nbsp; Operator.GREATER, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
StringGreaterEvaluator.INSTANCE );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEvaluator(
ValueType.STRING_TYPE,<br>
&gt; &nbsp; &nbsp; Operator.GREATER_OR_EQUAL, &nbsp;
&nbsp;StringGreaterOrEqualEvaluator.INSTANCE );<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Now Im am trying to wire it, with the following..<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; CustomComparableEvaluatorsDefinition<br>
&gt; &nbsp; &nbsp; MyCustomComparable custom = *new*<br>
&gt; &nbsp; &nbsp; CustomComparableEvaluatorsDefinition();<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; KnowledgeBuilderConfiguration config =<br>
&gt; &nbsp; &nbsp; KnowledgeBuilderFactory./newKnowledgeBuilderConfiguration/();<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; EvaluatorOption option =<br>
&gt; &nbsp; &nbsp; EvaluatorOption./get/(_Operator./LESS/.toString()_, custom);<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; EvaluatorOption option2 =<br>
&gt; &nbsp; &nbsp; EvaluatorOption./get/(_Operator./LESS_OR_EQUAL/.toString()_,
custom);<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; EvaluatorOption option3 =<br>
&gt; &nbsp; &nbsp; EvaluatorOption./get/(_Operator./GREATER/.toString()_,
custom);<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; EvaluatorOption option4 =<br>
&gt; &nbsp; &nbsp; EvaluatorOption./get/(_Operator./GREATER_OR_EQUAL/.toString()_,
custom);<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; config.setOption(option);<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; config.setOption(option2);<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; config.setOption(option3);<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; config.setOption(option4);<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Firstly is this the correct approach?....<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; The problem im having is that in my drl files still flag
errors,<br>
&gt; &nbsp; &nbsp; when I do &#8220;test&#8221; &gt; &#8220;test2&#8221; , am I missing something?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Regards<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; &nbsp; &nbsp; *From:* <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
&gt; &nbsp; &nbsp; &lt;mailto:<a
href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;<o:p></o:p></span></font></p>

</div>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; [mailto:<a
href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><o:p></o:p></span></font></p>

</div>

<div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; &lt;mailto:<a
href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;]
*On Behalf Of *Asif Iqbal<br>
&gt; &nbsp; &nbsp; *Sent:* 15 July 2009 08:20<br>
&gt; &nbsp; &nbsp; *To:* Rules Users List<br>
&gt; &nbsp; &nbsp; *Subject:* RE: [rules-users] Getting hold of the Evaluator
Registry<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Edson,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Thanks for your replies they have really helped.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; 1) &nbsp; &nbsp; &nbsp; I am still not sure about creating a
new operator, since<br>
&gt; &nbsp; &nbsp; the &#8216;&gt;=&#8217; operator already exists it just does not cater
for strings,<br>
&gt; &nbsp; &nbsp; which I want to add. So would creating a new operator cause
the<br>
&gt; &nbsp; &nbsp; existing one to be overrriden when added to the registry?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; 2) &nbsp; &nbsp; &nbsp; Having looked at the examples and
tests you emailed, I am<br>
&gt; &nbsp; &nbsp; still unsure how to actually wire in the changes, say for
example I<br>
&gt; &nbsp; &nbsp; have replaced the existing &#8216;&gt;=&#8217; evaluator or created a
new evaluator<br>
&gt; &nbsp; &nbsp; so that &#8216;&gt;=&#8217; &nbsp;now handles strings. When writing
rules will the<br>
&gt; &nbsp; &nbsp; engine pick this up?.. or do I need to create a new jar by<br>
&gt; &nbsp; &nbsp; building?.. or do I need to update a configuration file?..
im just<br>
&gt; &nbsp; &nbsp; not sure&#8230;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; 3) &nbsp; &nbsp; &nbsp; Wouldn&#8217;t the following also add the
evaluator definition by<br>
&gt; &nbsp; &nbsp; replacing the existing one..<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; _PackageBuilderConfiguration_ pkgb = *_new_*_<br>
&gt; &nbsp; &nbsp; PackageBuilderConfiguration()_;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; _pkgb.getEvaluatorRegistry()_._addEvaluatorDefinition_(*new<br>
&gt; &nbsp; &nbsp; *ComparableEvaluatorsDefinition());<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; _PackageBuilder_ builder = *_new_*_<br>
&gt; &nbsp; &nbsp; PackageBuilder(pkgb)_;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; _builder.addPackageFromDrl(source)_;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; _Package_ pkg = _builder.getPackage()_;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; // Add the package to a _rulebase_ (deploy the<br>
&gt; &nbsp; &nbsp; rule package).<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; rules = _RuleBaseFactory./newRuleBase/()_;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; _rules__.addPackage(pkg)_;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Thanks for your help&#8230;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp;
------------------------------------------------------------------------<br>
&gt;<br>
&gt; &nbsp; &nbsp; *From:* <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
&gt; &nbsp; &nbsp; &lt;mailto:<a
href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;<o:p></o:p></span></font></p>

</div>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; [mailto:<a
href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; &lt;mailto:<a
href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;]
*On Behalf Of *Edson<br>
&gt; &nbsp; &nbsp; Tirelli<br>
&gt; &nbsp; &nbsp; *Sent:* 14 July 2009 23:05<br>
&gt; &nbsp; &nbsp; *To:* Rules Users List<br>
&gt; &nbsp; &nbsp; *Subject:* Re: [rules-users] Getting hold of the Evaluator
Registry<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;I am working in one example of drools features
where I implement<br>
&gt; &nbsp; &nbsp; a custom evaluator here:<br>
&gt;<br>
&gt; &nbsp; &nbsp; <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>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;I use the configuration file instead of API in
the example:<br>
&gt;<br>
&gt; &nbsp; &nbsp; <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>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;[]s<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;Edson<br>
&gt;<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; 2009/7/14 Edson Tirelli &lt;<a
href="mailto:tirelli@post.com">tirelli@post.com</a> &lt;mailto:<a
href="mailto:tirelli@post.com">tirelli@post.com</a>&gt;&gt;<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;Asif,<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;My recommendation is create a new operator for
you instead of<br>
&gt; &nbsp; &nbsp; overriding existing ones. Although if you really want to
replace the<br>
&gt; &nbsp; &nbsp; existing ones, setting the property or calling the API to
register a<br>
&gt; &nbsp; &nbsp; new operator will override the default.<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;See:<br>
&gt;<br>
&gt; &nbsp; &nbsp; <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>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;Test method:<br>
&gt;<br>
&gt; &nbsp; &nbsp; testEvaluatorConfiguration()<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;[]s<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;Edson<br>
&gt;<br>
&gt; &nbsp; &nbsp; 2009/7/14 Asif Iqbal &lt;<a
href="mailto:Asif.Iqbal@infor.com">Asif.Iqbal@infor.com</a><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:Asif.Iqbal@infor.com">Asif.Iqbal@infor.com</a>&gt;&gt;<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt;<br>
&gt; &nbsp; &nbsp; Hi,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; What I need to do is modify one of the evaluator classes<br>
&gt; &nbsp; &nbsp; specifically &#8216;&lt;=&#8217;, so that it can handle strings. Now I
know I need<br>
&gt; &nbsp; &nbsp; to create a class similar to ComparableEvaluatorDefinition.
But what<br>
&gt; &nbsp; &nbsp; I want to do is replace the existing one in the evaluator
registry<br>
&gt; &nbsp; &nbsp; with my implementation which will include the additional
String<br>
&gt; &nbsp; &nbsp; capability.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; From my understanding that should be all that is required.
Unless im<br>
&gt; &nbsp; &nbsp; missing something&#8230; now all I need to know is how do I get
hold of<br>
&gt; &nbsp; &nbsp; the evaluator registry?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Cheers<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; I<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; _______________________________________________<br>
&gt; &nbsp; &nbsp; rules-users mailing list<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@listsjboss.org</a>&gt;<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; <a
href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; --<br>
&gt; &nbsp; &nbsp; &nbsp;Edson Tirelli<br>
&gt; &nbsp; &nbsp; &nbsp;JBoss Drools Core Development<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; &nbsp;JBoss by Red Hat @ <a
href="http://www.jboss.com" target="_blank">www.jboss.com</a> &lt;<a
href="http://www.jboss.com" target="_blank">http://www.jboss.com</a>&gt;<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; --<br>
&gt; &nbsp; &nbsp; &nbsp;Edson Tirelli<br>
&gt; &nbsp; &nbsp; &nbsp;JBoss Drools Core Development<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; &nbsp;JBoss by Red Hat @ <a
href="http://www.jboss.com" target="_blank">www.jboss.com</a> &lt;<a
href="http://www.jboss.com" target="_blank">http://www.jboss.com</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; _______________________________________________<br>
&gt; &nbsp; &nbsp; rules-users mailing list<br>
&gt; &nbsp; &nbsp; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@listsjboss.org</a>&gt;<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; <a
href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; --<br>
&gt; &nbsp; &nbsp; &nbsp;Edson Tirelli<br>
&gt; &nbsp; &nbsp; &nbsp;JBoss Drools Core Development<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; &nbsp;JBoss by Red Hat @ <a
href="http://www.jboss.com" target="_blank">www.jboss.com</a> &lt;<a
href="http://www.jboss.com" target="_blank">http://www.jboss.com</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; _______________________________________________<br>
&gt; &nbsp; &nbsp; rules-users mailing list<br>
&gt; &nbsp; &nbsp; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@listsjboss.org</a>&gt;<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp; &nbsp; <a
href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; &nbsp;Edson Tirelli<br>
&gt; &nbsp;JBoss Drools Core Development<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt; &nbsp;JBoss by Red Hat @ <a href="http://www.jboss.com"
target="_blank">www.jboss.com</a> &lt;<a href="http://www.jboss.com"
target="_blank">http://www.jboss.com</a>&gt;<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&gt;<br>
&gt;<br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jbossorg</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users"
target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><a href="http://lists.jboss.org/mailman/listinfo/rules-users"
target="_blank">http://lists.jboss.org/mailman/listinfo/rules-users</a><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br clear=all>
<br>
-- <br>
&nbsp;Edson Tirelli<br>
&nbsp;JBoss Drools Core Development<br>
&nbsp;JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><o:p></o:p></span></font></p>

</div>

</body>

</html>