<br> This is wrong:<br><br> $data : MyFact( $anotherObj )<br><br> Is the parser accepting it without any error???? If so, it is a bug. <br> I can't even imagine what is the parsing result for such expression.<br><br>
This is also wrong:<br><br>
eval ($anotherObj.isDiscard() == true)<br><br> There is no previous binding for "$anotherObj". Only possible scenario is you defined it as a global. <br> So, whatever you are doing and seeing, I have no idea how you can execute rules.<br>
<br> 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> []s<br> Edson<br> <br><br><br><br><br><div class="gmail_quote">2008/5/13 sridhar123 <<a href="mailto:sridhar.peddinti@sabre.com">sridhar.peddinti@sabre.com</a>>:<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't work as desired. Here is my code:<br>
<div class="Ih2E3d"><br>
rule A<br>
Salience 10<br>
when<br>
$data : MyFact( $anotherObj )<br>
then<br>
</div> modify( $anotherObj ) {<br>
<div class="Ih2E3d"> setDiscard(true)<br>
}<br>
<br>
rule B<br>
Salience 5<br>
when<br>
eval ($anotherObj.isDiscard() == true)<br>
then<br>
...<br>
<br>
</div>It seems, all When conditions are executed first irrespective of "then"<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>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> rule A<br>
> Salience 10<br>
> when<br>
> $anotherObject: MyFact(discard != true)<br>
> then<br>
> modify($anotherObj){<br>
> setDiscard(true)<br>
> }<br>
><br>
><br>
> "Modify" update your fact in the current working memory.<br>
><br>
><br>
><br>
> sridhar123 escreveu:<br>
><br>
><br>
> It means, I can not fire all rules at once, I need to groups and change<br>
> focus in my java code?<br>
><br>
> I couldn't find any docs or examples to properly use Salience - could you<br>
> please share an example (if you have one)<br>
><br>
> thx<br>
><br>
><br>
><br>
> Alessandro Lazarotti wrote:<br>
><br>
><br>
> You need upate() the fact $anotherObj in Working Memory.<br>
><br>
> sridhar123 escreveu:<br>
><br>
><br>
> rule A<br>
> Salience 10<br>
> when<br>
> $data : MyFact( $anotherObj )<br>
> then<br>
> $anotherObj.setDiscard(true)<br>
><br>
> rule B<br>
> Salience 5<br>
> when<br>
> eval ($anotherObj.isDiscard() == true)<br>
> then<br>
> ...<br>
><br>
><br>
> I am trying to get Rule A executed before Rule B. So when condition in<br>
> Rule<br>
> B is valid. However i dont see "Saliene" has any effect. How else i can<br>
> do<br>
> the above?<br>
><br>
> thank you<br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> 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>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> 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>
><br>
><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>