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