&nbsp;&nbsp; Is there a Role object asserted into your working memory?<br><br>&nbsp;&nbsp; Remember that adding the Role pattern to your rule will make your rule fire once for each Role object. If you don&#39;t have any role object, the rule obviously will not fire.
<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><br><br><div><span class="gmail_quote">2007/4/5, fakhfakh ismail &lt;<a href="mailto:ismail_info2005@yahoo.fr">ismail_info2005@yahoo.fr</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>when I run the code<br><br>rule &quot;sample1&quot;<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 == &quot;10&quot;, email matches &quot;.*@<a href="http://yahoo.fr" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
yahoo.fr</a>&quot;)</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 &#39;s nothing affiched the portion RHS didn&#39;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&#39;t remove it and I want the portion RHS execute<br><br></span><br><br><b><i>Marko Frankovic &lt;<a href="mailto:paparapap@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
paparapap@gmail.com</a>&gt;</i></b> a écrit&nbsp;:<blockquote 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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://sourceforge.net/projects/droolsruleedit</a> . It&#39;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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
John.Tal@gxs.com</a></b> &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><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 &#39;standard&#39; 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><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* &quot;UCCnet_DVE_Depth_All&quot; 
</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(&quot;depth&quot;);</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 == &quot;&quot; )</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(&quot;Package
 Depth is Blank&quot;);</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(&quot;depth&quot;) 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: &quot;Michael Neale&quot; &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: &quot;Rules Users List&quot; &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=&quot;iso-8859-1&quot;</span>
</font></div><div><span><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&#39;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(&quot;depth&quot;) == *null* ||</span></font></div><div><font face="Courier New" size="2">
<span style="font-size: 10pt;">catalogObject.getElementValue (&quot;depth&quot;) == &quot;&quot; )</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*
 &quot;UCCnet_DVE_Depth_All&quot;</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(&quot;depth&quot;) == *null* || </span>
</font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">&gt; catalogObject.getElementValue(&quot;depth&quot;) == &quot;&quot; )</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(&quot;Package Depth is Blank&quot;);</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* &quot;UCCnet_DVE_Depth_All&quot;</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(&quot;depth&quot;);</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 == &quot;&quot; )
</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
(&quot;Package Depth is Blank&quot;);</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 &#39;s&#39;&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 href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.jboss.org/mailman/listinfo/rules-users </a><br><br></blockquote></div><br> _______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br></blockquote><span class="ad"><br><p> 
                </p><hr size="1"> 
Découvrez une nouvelle façon d&#39;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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Yahoo! Questions/Réponses</a>.<p></p></span><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 clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3124-6000<br>&nbsp;&nbsp;Mobile: +55 11 9218-4151<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ 
<a href="http://www.jboss.com">www.jboss.com</a>