<div dir="ltr"><br>&nbsp; You must escape ( ...<br><br>[condition][]\(=(<br>
<br>&nbsp; But I&#39;m not sure it will work, because expansion is doing nothing... I mean, text before and after expansion is the same and the system was designed to check for changes...<br>&nbsp; Do you need to have ( alone in a line? Can&#39;t you use a more textual representation for &quot;( or&quot;? Like:<br>
<br>rule XYX<br>when<br>&nbsp;&nbsp;&nbsp; Either<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Condition_1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Condition_2<br>&nbsp;&nbsp;&nbsp; End_Either<br>&nbsp;then<br>&nbsp;&nbsp;&nbsp; Action_1<br>end<br><br>&nbsp;&nbsp; So you can map Either to &quot;( or&quot; and End_either or whatever word you chose to &quot;)&quot;?<br>
<br>&nbsp;&nbsp; Just trying to find alternate ways.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><div class="gmail_quote">2008/8/8 Yu Wang <span dir="ltr">&lt;<a href="mailto:yuwarm@gmail.com">yuwarm@gmail.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;">
This doesn&#39;t work. &nbsp;:(<br>
<br>
Acutally I am using the eclipse plugin and the DSL viewer shows that<br>
the source code looks fine. The code I put in my first email was taken<br>
from the DSL viewer.<br>
<br>
but when I add the three lines:<br>
[condition][](=(<br>
[condition][])=)<br>
[condition][]or=or<br>
<br>
The DSL viewer refuses to work and shows the following msg:<br>
DSL Rule Translation Error!<br>
Reason:<br>
java.util.regex.PatternSyntaxException: Unclosed group near index 13<br>
(\W|^)((\W|$)<br>
<br>
I think it means &quot;(&quot; in the last word.<br>
I also tried &quot;(&quot;=&quot;(&quot;, and &#39;(&#39;, didn&#39;t work either.<br>
So I can&#39;t add the three mappings this way. Any ideas? Thanks!<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
<br>
On 8/8/08, Yu Wang &lt;<a href="mailto:yuwarm@gmail.com">yuwarm@gmail.com</a>&gt; wrote:<br>
&gt; Thanks for your reply. Yes, I am using a DSL. So what you mean is I<br>
&gt; need to add 3 mappings in DSL like the following:<br>
&gt; ( mapped to (<br>
&gt; ) mapped to )<br>
&gt; or mapped to or<br>
&gt; right? I&#39;ll try that.<br>
&gt; Thanks a lot!<br>
&gt;<br>
&gt; On 8/8/08, Edson Tirelli &lt;<a href="mailto:tirelli@post.com">tirelli@post.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; &nbsp; &nbsp;The error message indicates you are using DSL and the problem is not in<br>
&gt; &gt; the DRL, but in DSL.<br>
&gt; &gt; &nbsp; &nbsp;DSL requires every single line to be &quot;matches&quot; (or expanded), so if you<br>
&gt; &gt; have a line with a single ( and nothing more, either you have a mapping for<br>
&gt; &gt; it, or you escape the line with &quot;&gt;&quot;.<br>
&gt; &gt;<br>
&gt; &gt; &nbsp; &nbsp;Best way to fix your problem is to use the drools eclipse plugin for<br>
&gt; &gt; .dslr files, and using the DRL preview feature.<br>
&gt; &gt;<br>
&gt; &gt; &nbsp; &nbsp;[]s<br>
&gt; &gt; &nbsp; &nbsp;Edson<br>
&gt; &gt;<br>
&gt; &gt; 2008/8/8 Yu Wang &lt;<a href="mailto:yuwarm@gmail.com">yuwarm@gmail.com</a>&gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Hi, I need help in making the &quot;or&quot; work. I have the following rule:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; rule<br>
&gt; &gt; &gt; when<br>
&gt; &gt; &gt; (<br>
&gt; &gt; &gt; or<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; Condition_clause_1<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; Condition_clause_2<br>
&gt; &gt; &gt; )<br>
&gt; &gt; &gt; then<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;Consequence_clause_1<br>
&gt; &gt; &gt; end<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; -------------<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; It gives me the following compilation error:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; org.drools.rule.InvalidRulePackage: [4] Unable to expand:<br>
&gt; &gt; ( &nbsp;[5]<br>
&gt; &gt; &gt; Unable to expand: or &nbsp; &nbsp;[8] Unable to expand: )<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Seems it doesn&#39;t recognize &quot;(&quot;, &quot;or&quot;, and &quot;)&quot;. But I totally follow<br>
&gt; &gt; &gt; the documentation on section <a href="http://6.5.2.3" target="_blank">6.5.2.3</a> of version <a href="http://4.0.7." target="_blank">4.0.7.</a><br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Any help is highly appreciated.<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; rules-users mailing list<br>
&gt; &gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; &gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Edson Tirelli<br>
&gt; &gt; JBoss Drools Core Development<br>
&gt; &gt; JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; rules-users mailing list<br>
&gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>