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