<br>&nbsp; This is wrong:<br><br> $data : MyFact( $anotherObj )<br><br>&nbsp;&nbsp; Is the parser accepting it without any error???? If so, it is a bug. <br>&nbsp;&nbsp; I can&#39;t even imagine what is the parsing result for such expression.<br><br>
&nbsp;&nbsp; This is also wrong:<br><br>&nbsp;
 eval ($anotherObj.isDiscard() == true)<br><br>&nbsp;&nbsp; There is no previous binding for &quot;$anotherObj&quot;. Only possible scenario is you defined it as a global. <br>&nbsp;&nbsp; So, whatever you are doing and seeing, I have no idea how you can execute rules.<br>
<br>&nbsp;&nbsp; Can you show us the whole DRL file you are using? Can you show the snippet of code you are using to execute it?<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br>&nbsp;&nbsp; <br><br><br><br><br><div class="gmail_quote">2008/5/13 sridhar123 &lt;<a href="mailto:sridhar.peddinti@sabre.com">sridhar.peddinti@sabre.com</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
It still dosen&#39;t work as desired. Here is my code:<br>
<div class="Ih2E3d"><br>
 &nbsp; &nbsp; &nbsp;rule A<br>
Salience 10<br>
when<br>
&nbsp;$data : MyFact( $anotherObj )<br>
then<br>
</div> &nbsp;modify( &nbsp;$anotherObj ) {<br>
<div class="Ih2E3d"> &nbsp; &nbsp; setDiscard(true)<br>
 &nbsp; }<br>
<br>
rule B<br>
Salience 5<br>
when<br>
 &nbsp;eval ($anotherObj.isDiscard() == true)<br>
then<br>
&nbsp;...<br>
<br>
</div>It seems, all When conditions are executed first irrespective of &quot;then&quot;<br>
<br>
I also tried with agenda group and having default focus on Rule A and in<br>
Then section setting focus to Rule B - still the condition doesnt match.<br>
When i inspect fact - after Rule A is executed, i see my flag is set to true<br>
- but not visible to Rule B.<br>
<br>
Do i need to write seperate drl files. Also, i am using eclipse 3.3 and<br>
ruleflow seems buggy i can not add any rule flow groups. do i need to use<br>
3.2. I am using Drools 4.0.4<br>
<br>
thank you<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
<br>
<br>
Alessandro Lazarotti wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; rule A<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;Salience 10<br>
&gt; &nbsp;when<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; $anotherObject: MyFact(discard != true)<br>
&gt; &nbsp;then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; modify($anotherObj){<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;setDiscard(true)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;<br>
&gt;<br>
&gt; &quot;Modify&quot; update your fact in the current working memory.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; sridhar123 escreveu:<br>
&gt;<br>
&gt;<br>
&gt; It means, I can not fire all rules at once, I need to groups and change<br>
&gt; focus in my java code?<br>
&gt;<br>
&gt; I couldn&#39;t find any docs or examples to properly use Salience - could you<br>
&gt; please share an example (if you have one)<br>
&gt;<br>
&gt; thx<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Alessandro Lazarotti wrote:<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; You need upate() the fact $anotherObj in Working Memory.<br>
&gt;<br>
&gt; sridhar123 escreveu:<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; rule A<br>
&gt; Salience 10<br>
&gt; when<br>
&gt; &nbsp;$data : MyFact( $anotherObj )<br>
&gt; then<br>
&gt; &nbsp; $anotherObj.setDiscard(true)<br>
&gt;<br>
&gt; rule B<br>
&gt; Salience 5<br>
&gt; when<br>
&gt; &nbsp; eval ($anotherObj.isDiscard() == true)<br>
&gt; then<br>
&gt; &nbsp; &nbsp;...<br>
&gt;<br>
&gt;<br>
&gt; I am trying to get Rule A executed before Rule B. So when condition in<br>
&gt; Rule<br>
&gt; B is valid. However i dont see &quot;Saliene&quot; has any effect. How else i can<br>
&gt; do<br>
&gt; the above?<br>
&gt;<br>
&gt; thank you<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Salience-not-working-tp17190028p17217969.html" target="_blank">http://www.nabble.com/Salience-not-working-tp17190028p17217969.html</a><br>
</font><div class="Ih2E3d">Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="Wj3C7c">rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>