Is there a Role object asserted into your working memory?<br><br> Remember that adding the Role pattern to your rule will make your rule fire once for each Role object. If you don't have any role object, the rule obviously will not fire.
<br><br> []s<br> Edson<br><br><br><br><div><span class="gmail_quote">2007/4/5, fakhfakh ismail <<a href="mailto:ismail_info2005@yahoo.fr">ismail_info2005@yahoo.fr</a>>:</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 "sample1"<br>when<br> <br> <span style="font-weight: bold;"> $P: User( $nam : name, userId == "10", email matches ".*@<a href="http://yahoo.fr" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
yahoo.fr</a>")</span><br style="font-weight: bold;"><span style="font-weight: bold;"> $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;"> System.out.println($P.getname());</span><br style="font-weight: bold;"><span style="font-weight: bold;"> </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 <<a href="mailto:paparapap@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
paparapap@gmail.com</a>></i></b> a écrit :<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'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> <<a href="mailto:John.Tal@gxs.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">John.Tal@gxs.com</a>> 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;"> </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. 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;"> </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;"> </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> *rule* "UCCnet_DVE_Depth_All"
</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> *when*</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> catalogObject : CatalogObject( )
</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> String s = catalogObject.getElementValue("depth");</span></font></div><div><font face="Courier New" size="2">
<span style="font-size: 10pt;"> > *eval*( s == *null* || s == "" )</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> *then*</span></font></div><div><font face="Courier New" size="2">
<span style="font-size: 10pt;"> > logWriter.logDebug("Package
Depth is Blank");</span></font></div></span><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> *end*</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">
</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. Those values need to be on the drools (not java) side of the world. 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. 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;"> </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. 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;"> </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;"> </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;"> </span>
</font></div> <div><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></div><div><font face="Courier
New" size="2"><span style="font-size: 10pt;"> </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> </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" < <a href="mailto:michael.neale@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
michael.neale@gmail.com</a>></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" <<a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> rules-users@lists.jboss.org</a>></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;"> < <a href="mailto:96ab3ced0704042347s130a4b46ma4a5b74fb45ef0d4@mail.gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
96ab3ced0704042347s130a4b46ma4a5b74fb45ef0d4@mail.gmail.com</a>></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><div><font face="Courier New" size="2"> <span style="font-size: 10pt;"> </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;"> </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> </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"> </span></font>
</div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;" lang="FR"> *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;"> </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> <<a href="mailto:John.Tal@gxs.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
John.Tal@gxs.com</a>> wrote:</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> > </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> Ok, Thanks for the help on the drl syntax.
</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> > </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> So this works.</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size: 10pt;">> </span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">> *rule*
"UCCnet_DVE_Depth_All"</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> *when*</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">
> catalogObject : CatalogObject( )</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> *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;">
> *then*</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">>
logWriter.logDebug("Package Depth is Blank");</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">> *end*</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">
> </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> 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;">> </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> *rule* "UCCnet_DVE_Depth_All"</span> </font></div><div><font face="Courier New" size="2">
<span style="font-size: 10pt;">> *when*</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> catalogObject : CatalogObject( ) </span></font></div><div><font face="Courier
New" size="2"><span style="font-size: 10pt;">> String s = catalogObject.getElementValue("depth");</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> > *eval*( s == *null* || s == "" )
</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> *then*</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;"> > logWriter.logDebug
("Package Depth is Blank");</span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> *end*</span></font></div><div><font face="Courier New" size="2"> <span style="font-size: 10pt;">
> </span></font></div><div><font face="Courier New" size="2"><span style="font-size: 10pt;">> I am getting an
Unexpected token 's' InvalidRulePackage</span></font></div><div><font face="Arial" size="2"> <span style="font-size: 10pt; font-family: Arial;"> </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'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> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3124-6000<br> Mobile: +55 11 9218-4151<br> JBoss, a division of Red Hat @
<a href="http://www.jboss.com">www.jboss.com</a>