<div dir="ltr"><br> You must escape ( ...<br><br>[condition][]\(=(<br>
<br> But I'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> Do you need to have ( alone in a line? Can't you use a more textual representation for "( or"? Like:<br>
<br>rule XYX<br>when<br> Either<br> Condition_1<br> Condition_2<br> End_Either<br> then<br> Action_1<br>end<br><br> So you can map Either to "( or" and End_either or whatever word you chose to ")"?<br>
<br> Just trying to find alternate ways.<br><br> Edson<br><br><div class="gmail_quote">2008/8/8 Yu Wang <span dir="ltr"><<a href="mailto:yuwarm@gmail.com">yuwarm@gmail.com</a>></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't work. :(<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 "(" in the last word.<br>
I also tried "("="(", and '(', didn't work either.<br>
So I can'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 <<a href="mailto:yuwarm@gmail.com">yuwarm@gmail.com</a>> wrote:<br>
> Thanks for your reply. Yes, I am using a DSL. So what you mean is I<br>
> need to add 3 mappings in DSL like the following:<br>
> ( mapped to (<br>
> ) mapped to )<br>
> or mapped to or<br>
> right? I'll try that.<br>
> Thanks a lot!<br>
><br>
> On 8/8/08, Edson Tirelli <<a href="mailto:tirelli@post.com">tirelli@post.com</a>> wrote:<br>
> ><br>
> > The error message indicates you are using DSL and the problem is not in<br>
> > the DRL, but in DSL.<br>
> > DSL requires every single line to be "matches" (or expanded), so if you<br>
> > have a line with a single ( and nothing more, either you have a mapping for<br>
> > it, or you escape the line with ">".<br>
> ><br>
> > Best way to fix your problem is to use the drools eclipse plugin for<br>
> > .dslr files, and using the DRL preview feature.<br>
> ><br>
> > []s<br>
> > Edson<br>
> ><br>
> > 2008/8/8 Yu Wang <<a href="mailto:yuwarm@gmail.com">yuwarm@gmail.com</a>><br>
> > ><br>
> > > Hi, I need help in making the "or" work. I have the following rule:<br>
> > ><br>
> > ><br>
> > > rule<br>
> > > when<br>
> > > (<br>
> > > or<br>
> > > Condition_clause_1<br>
> > > Condition_clause_2<br>
> > > )<br>
> > > then<br>
> > > Consequence_clause_1<br>
> > > end<br>
> > ><br>
> > > -------------<br>
> > ><br>
> > > It gives me the following compilation error:<br>
> > ><br>
> > > org.drools.rule.InvalidRulePackage: [4] Unable to expand:<br>
> > ( [5]<br>
> > > Unable to expand: or [8] Unable to expand: )<br>
> > ><br>
> > > Seems it doesn't recognize "(", "or", and ")". But I totally follow<br>
> > > 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>
> > ><br>
> > ><br>
> > > Any help is highly appreciated.<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>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Edson Tirelli<br>
> > JBoss Drools Core Development<br>
> > JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
> ><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>
> ><br>
><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>