<p>Hi,<br /><br />I have seen the ticket in JIRA. But to be sure to be
understood, I give an other example.<br /><br />I would find a way to write
this DRL code :<br /></p><pre>Person( age ( (> 30 && < 40) ||
(> 20 && < 25) ),name == 'DOE' )</pre><p><br />In DSL code like
this :<br /></p><pre>There is a Person with</pre><pre>        ((- age is less than
40<br />         - age is more than 30)<br />         or<br />         (- age is more than
20<br />         - age is less than 25))<br />         - name is 'DOE'</pre><p><br
/>Thanks andy for the ticket post :)<br /><br />Stephane</p><p></p><p>
Andy Mei <andy.d.mei@gmail.com> a écrit :</p><br />
<br />
> Ok, i took the liberty and created a ticket for this.<br />
><br />
> <a target="_blank"
href="https://mail.agysoft.fr/horde/services/go.php?url=http%3A%2F%2Fjira.jboss.com%2Fjira%2Fbrowse%2FJBRULES-1186">http://jira.jboss.com/jira/browse/JBRULES-1186</a><br
/>
><br />
><br />
> On 9/12/07, Edson Tirelli <tirelli@post.com> wrote:<br />
>><br />
>><br />
>> All,<br />
>><br />
>> This is a limitation of the current DSL engine implementation.
The<br />
>> problem is not really the "or", but the "-"
implementation. The LHS and RHS<br />
>> of a DSL rule are processed line by line, so, to allow the behavior you
are<br />
>> requesting, we will need to implement some look ahead mechanism with
smart<br />
>> interpolation that does not exist today.<br />
>> I'm not sure if someone already opened a ticket for that, but in
case<br />
>> not, may I ask you please to open? We will look into supporting that in
the<br />
>> future.<br />
>><br />
>> []s<br />
>> Edson<br />
>><br />
>><br />
>> 2007/9/12, Andy Mei <andy.d.mei@gmail.com>:<br />
>> ><br />
>> > I am having the same problem as Stephane does.<br />
>> ><br />
>> > It's pretty bad if I need to hard code the 'or' constraint within
a<br />
>> > single DSL constraint. I guess I could split a complex OR
constraint to<br />
>> > multiple rules with the same consequences, it just an ugly hack.
<br />
>> Also, how<br />
>> > does this work if we need a Or constraint within another group
constraint?<br />
>> ><br />
>> > I just don't understand why the following doesn't work.<br />
>> ><br />
>> > [condition][]There is a Cheese with=Cheese()<br />
>> > [condition][]- age is less than {low} =age < {low}<br />
>> > [condition][]Or=or<br />
>> > [condition][]- age is more than {high}=age > {high}<br />
>> ><br />
>> > On 9/11/07, stephane.remillieux@agysoft.fr <<br />
>> > stephane.remillieux@agysoft.fr> wrote:<br />
>> ><br />
>> > > Hi Vincent,<br />
>> > ><br />
>> > > Thanks for your answer but I would really like to use my
synthax.<br />
>> > ><br />
>> > > I need to write "or" between 2 constraints and not
in a single complex<br />
>> > > constraint.<br />
>> > ><br />
>> > > If someone else could help me ...<br />
>> > ><br />
>> > > DELBART Vincent <delbart.v@mipih.fr> a écrit :<br />
>> > ><br />
>> > ><br />
>> > > > Hello Stephane,<br />
>> > > ><br />
>> > > > I think it's difficult to do that. Could you try this
:<br />
>> > > > There is a Cheese with<br />
>> > > > - age is less than 42 or age is more than 60<br
/>
>> > > > - type is 'stilton'<br />
>> > > > with in your DSL<br />
>> > > > [condition][]There is a Cheese with=Cheese()<br />
>> > > > [condition][]- age is less than {low} or age is more
than {high}=age<br />
>> > ><br />
>> > > > < {low} || age > {high}<br />
>> > > > [condition][]- type is '{type}'=type ==
"{type}"<br />
>> > > ><br />
>> > > > I don't see other solution...<br />
>> > > ><br />
>> > > > vdelbart<br />
>> > > ><br />
>> > > ><br />
>> > > ><br />
>> > > > ________________________________<br />
>> > > ><br />
>> > > > De : rules-users-bounces@lists.jboss.org<br />
>> > > > [mailto:rules-users-bounces@lists.jboss.org] De la part
de<br />
>> > > > stephane.remillieux@agysoft.fr<br />
>> > > > Envoyé : mardi 11 septembre 2007 10:16<br />
>> > > > À : rules-users@lists.jboss.org<br />
>> > > > Objet : [rules-users] Adding constraints to facts in
DSL<br />
>> > > ><br />
>> > > ><br />
>> > > ><br />
>> > > > Hello,<br />
>> > > ><br />
>> > > > I'm using JBossDrools in my company and I have some
problems with<br />
>> > > DSL.<br />
>> > > ><br />
>> > > > Actually, I would like to write something like this :<br
/>
>> > > ><br />
>> > > > There is a Cheese with<br />
>> > > > ( - age is less<br />
>> > > > than 42<br />
>> > > > or<br />
>> > > > - age is more than 60 )<br />
>> > > > - type is<br />
>> > > > 'stilton'<br />
>> > > ><br />
>> > > > Unfortunately, It's the drools parser which manage
"-" char.<br />
>> > > ><br />
>> > > > Also this previous synthax don't work in the LHS.<br />
>> > > ><br />
>> > > > Anyone could help me to do an equivalent condition in my
DSL ? If<br />
>> > > > possible with "-" sugar char.<br />
>> > > ><br />
>> > > > Stephane.<br />
>> > > ><br />
>> > > > PS : Sorry, for my very bad english.<br />
>> > > ><br />
>> > > ><br />
>> > > >
----------------------------------------------------------------<br />
>> > > > This message was sent using IMP, the Internet Messaging
Program.<br />
>> > > ><br />
>> > > ><br />
>> > ><br />
>> > ><br />
>> > ><br />
>> > >
----------------------------------------------------------------<br />
>> > > This message was sent using IMP, the Internet Messaging
Program.<br />
>> > ><br />
>> > > _______________________________________________<br />
>> > > rules-users mailing list<br />
>> > > rules-users@lists.jboss.org<br />
>> > > <a target="_blank"
href="https://mail.agysoft.fr/horde/services/go.php?url=https%3A%2F%2Flists.jboss.org%2Fmailman%2Flistinfo%2Frules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br
/>
>> > ><br />
>> > ><br />
>> ><br />
>> > _______________________________________________<br />
>> > rules-users mailing list<br />
>> > rules-users@lists.jboss.org<br />
>> > <a target="_blank"
href="https://mail.agysoft.fr/horde/services/go.php?url=https%3A%2F%2Flists.jboss.org%2Fmailman%2Flistinfo%2Frules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br
/>
>> ><br />
>> ><br />
>><br />
>><br />
>> --<br />
>> Edson Tirelli<br />
>> Software Engineer - JBoss Rules Core Developer<br />
>> Office: +55 11 3529-6000<br />
>> Mobile: +55 11 9287-5646<br />
>> JBoss, a division of Red Hat @ www.jboss.com<br />
>> _______________________________________________<br />
>> rules-users mailing list<br />
>> rules-users@lists.jboss.org<br />
>> <a target="_blank"
href="https://mail.agysoft.fr/horde/services/go.php?url=https%3A%2F%2Flists.jboss.org%2Fmailman%2Flistinfo%2Frules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br
/>
>><br />
>><br />
><br />
<br />
<div id="_booktextmark_tab_id_" title="1190377692962" style="visibility:
hidden;"></div><br />
<br />
----------------------------------------------------------------<br />
This message was sent using IMP, the Internet Messaging Program.<br />