Hello,<br>when I run the code<br><br>rule "sample1"<br>when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight: bold;">&nbsp; $P: User( $nam : name, userId == "10", email matches ".*@yahoo.fr")</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $role :Role($name : name, $users: users)</span><br style="font-weight: bold;"><span style="font-weight: bold;">then</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println($P.getname());</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; </span><span style="font-weight: bold;">end</span><br style="font-weight: bold;"><br>there 's nothing affiched the portion RHS didn't execute<br><br>but when I remove<br><span style="font-weight: bold;">$role :Role($name : name, $users: users)<br><br>the
 result waited is affiched<br>but I don't remove it and I want the portion RHS execute<br><br></span><br><br><b><i>Marko Frankovic &lt;paparapap@gmail.com&gt;</i></b> a écrit&nbsp;:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Try this out : <a href="http://sourceforge.net/projects/droolsruleedit">http://sourceforge.net/projects/droolsruleedit</a> . It's in early development stage, but it might help you.<br><br><div><span class="gmail_quote"> On 4/5/07, <b class="gmail_sendername"><a href="mailto:John.Tal@gxs.com">John.Tal@gxs.com</a></b> &lt;<a href="mailto:John.Tal@gxs.com">John.Tal@gxs.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div link="#0000ff" vlink="#800080" lang="EN-US"><div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">Drools
 developers,</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> &nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">In our specific use case we have customers who need to be able to write validation rules and NOT have to resort to writing them in Java. &nbsp;Hence our interest in using drools as an open source 'standard' to potentially replace a proprietary rules engine we already have. </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">In the previous case I mentioned where I want to do this: </span></font></div><span class="q"><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt; *rule* "UCCnet_DVE_Depth_All" </span></font></div><div><font
 face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *when*</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catalogObject : CatalogObject( ) </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String s = catalogObject.getElementValue("depth");</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *eval*( s == *null* || s == "" )</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *then*</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logWriter.logDebug("Package
 Depth is Blank");</span></font></div></span><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt; *end*</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">This is because potentially, in our use for data validation, there might be 50 values we need to compare against. &nbsp;Those values need to be on the drools (not java) side of the world. &nbsp;So getting the result of  catalogObject.getElementValue("depth") into a String variable and being able to use String methods like indexOf or multiple || cases is much more desirable than crossing from the rule back into the object by having to call getElementValue 50 times.&nbsp; There are numerous, other cases, where the result of  catalogObject.getElementValue need to be saved into a local drools variable and evaluated multiple times without encurring the overhead of multiple
 calls back into java.</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">Please consider enhancing drl syntax to support this use case. &nbsp;Is there a bug/enhancement process for me to follow to submit this functionality request. </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">Thanks</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">John</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></div> <div><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></div><div><font face="Courier
 New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> &nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">Date: Thu, 5 Apr 2007 16:47:07 +1000</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">From: "Michael Neale" &lt; <a href="mailto:michael.neale@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">michael.neale@gmail.com</a>&gt;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> Subject: Re: [rules-users] RE: Need DRL authoring Help</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">To: "Rules Users List" &lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> rules-users@lists.jboss.org</a>&gt;</span></font></div><div><font
 face="Courier New" size="2"><span style="font-size: 10pt;">Message-ID:</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt; <a href="mailto:96ab3ced0704042347s130a4b46ma4a5b74fb45ef0d4@mail.gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">96ab3ced0704042347s130a4b46ma4a5b74fb45ef0d4@mail.gmail.com</a>&gt;</span> </font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">Content-Type: text/plain; charset="iso-8859-1"</span></font></div><div><span class="e" id="q_111c1f175564a621_3"><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">OK you are really bending what you would use rules for, I really wouldn't recommend that. flattening the object model would allow you to write rules over it, but as it stands, its just going to be a bit
 difficult for you. </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font face="Courier New" size="2"> <span style="font-size: 10pt;" lang="FR">catalogObject : CatalogObject( )</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;" lang="FR">&nbsp;</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;" lang="FR">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *eval*( catalogObject.getElementValue("depth") == *null* ||</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">catalogObject.getElementValue ("depth") == "" )</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></div><div><font face="Courier New" size="2"><span
 style="font-size: 10pt;">On 4/5/07, <a href="mailto:John.Tal@gxs.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> John.Tal@gxs.com</a> &lt;<a href="mailto:John.Tal@gxs.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">John.Tal@gxs.com</a>&gt; wrote:</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> &gt;&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp; Ok,&nbsp; Thanks for the help on the drl syntax.</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> &gt;&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt; So this works.</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">&gt; *rule*
 "UCCnet_DVE_Depth_All"</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *when*</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catalogObject : CatalogObject( )</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *eval*( catalogObject.getElementValue("depth") == *null* || </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt; catalogObject.getElementValue("depth") == "" )</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *then*</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 logWriter.logDebug("Package Depth is Blank");</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">&gt; *end*</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt; But how do I get the drl parser to accept something like this: </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt; *rule* "UCCnet_DVE_Depth_All"</span> </font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *when*</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catalogObject : CatalogObject( ) </span></font></div><div><font face="Courier
 New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String s = catalogObject.getElementValue("depth");</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *eval*( s == *null* || s == "" )</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *then*</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logWriter.logDebug("Package Depth is Blank");</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt; *end*</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">&gt;&nbsp;</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt; I am getting an
 Unexpected token 's'&nbsp; InvalidRulePackage</span></font></div><div><font face="Arial" size="2"> <span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></div></span></div></div></div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org"> rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users </a><br><br></blockquote></div><br> _______________________________________________<br>rules-users mailing list<br>rules-users@lists.jboss.org<br>https://lists.jboss.org/mailman/listinfo/rules-users<br></blockquote><br><p>&#32;
                <hr size="1"> 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur <a href="http://fr.rd.yahoo.com/evt=42054/*http://fr.answers.yahoo.com">Yahoo! Questions/Réponses</a>.