<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
Hi Wolfgang,<br>
<br>
Many thanks for you answer! I finally decided to download Drools
sources in order to debug my program.<br>
Following your advice (starting from EvaluatorRegistry), I finally
found that adding a simple "PackageBuilder builder = new
PackageBuilder();" statement at the beginning of my program does the
trick. For a reason that I don't understand (maybe a ClassLoader or
static initialization side-effect), even though that "builder" variable
is not used afterwards, it helps my DrlParser accepting the "matches"
operator.<br>
So the final code is (for those interested in):<br>
<br>
<tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PackageBuilder builder = new PackageBuilder(); // not used<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Resource brlresource =
ResourceFactory.newClassPathResource("com/sample/TestRule.brl");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; BusinessRuleProvider provider =
BusinessRuleProviderFactory.getInstance().getProvider();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reader knowledge = provider.getKnowledgeReader(brlresource);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DrlParser parser = new DrlParser();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PackageDescr pkg = parser.parse(knowledge);<br>
</tt><br>
Cheers,<br>
<br>
Bruno.<br>
<br>
<br>
Wolfgang Laun a &eacute;crit&nbsp;:
<blockquote
 cite="mid:AANLkTi=+q73Qy3bPiXwwRZ8nR3gqWWo35ceG3-gdTjR5@mail.gmail.com"
 type="cite">
  <pre wrap="">All the operators that are represented as Keywords must be made known
to the parser;
this includes all the predefined ones. This is done in class EvaluatorRegistry..
See org/drools/base/evaluators/EvaluatorRegistry,java and
org/drools/compiler/PackageBuilderConfiguration.java.

Best
-W



On 18 October 2010 11:05, Bruno Freudensprung
<a class="moz-txt-link-rfc2396E" href="mailto:bruno.freudensprung@temis.com">&lt;bruno.freudensprung@temis.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi,

I am using Drools 5.1.1 (but also tried with 5.2.0.SNAPSHOT) to achieve
the following scenario:
1 - use the Drools' Eclipse graphical rule editor to create a BRL file
2 - convert the BRL to DRL using the
org.drools.ide.common.server.util.BRXMLPersistence and
org.drools.ide.common.server.util.BRDRLPersistence classes
3 - parse the DRL with the org.drools.compiler.DrlParser class (in order
to do some things)

I have a problem with DrlParser class that does not seem to accept the
"matches" and "soundslike" operators.
With the following rule... :

rule "TestRule"
&nbsp; &nbsp;dialect "mvel"
&nbsp; &nbsp;when
&nbsp; &nbsp; &nbsp; &nbsp;Document( text soundslike "drink" )
&nbsp; &nbsp;then
&nbsp; &nbsp; &nbsp; &nbsp;// some
end

... I get that error message from the DrlParser:

src/main/resources/org/drools/lang/DescrBuilderTree.g: node from line
0:0 mismatched tree node: &lt;unexpected:
[@15,55:64='soundslike',&lt;83&gt;,4:17], resync=soundslike&gt; expecting &lt;UP&gt;

Does anyone has an idea of what's going on?
Many thanks,

Bruno.
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>

    </pre>
  </blockquote>
  <pre wrap=""><!---->
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>

  </pre>
</blockquote>
<br>
</body>
</html>