I totally agree with Wolfgang here.<br><br><div class="gmail_quote">On Thu, Aug 26, 2010 at 11:21, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I am surprised, all the more so because (cf. Expert):<br><br> "Each rule has a salience attribute that can be assigned an integer <i><b>number</b></i>,"<br>
<br>This does not event remotely indicate that you can use an <i><b>expression</b></i> involving bound variables.<br>
<br>If it isn't documented, nobody will use it. Being in front of the when part where the bindings occur, it is counter-intuitive to other bound variable references, and so I didn't even try.<br><br>However: good to know, and thanks!<br>
<font color="#888888">
<br>-W</font><div><div></div><div class="h5"><br><br><br>On 26 August 2010 15:21, Edson Tirelli <<a href="mailto:tirelli@post.com" target="_blank">tirelli@post.com</a>> wrote:<br>> Wolfgang,<br>> Not sure I understand what you mean, but Drools supports dynamic<br>
> salience:<br>> rule "fire in rank order 1,2,..."<br>> salience( -$rank )<br>> when<br>> Element( $rank : rank,... )<br>> ...<br>> then<br>> ...<br>> end<br>> Edson<br>
><br>> 2010/8/26 Wolfgang Laun <<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>><br>>><br>>> Just FYI, but who knows ;-)<br>>><br>>> Our proprietary vintage RBS has a feature is (admittedly) rarely used<br>
>> but could come in handy, every now and then.<br>>><br>>> Given this class<br>>><br>>> class Element {<br>>> int rank; // rank > 0<br>>> }<br>>><br>>> and to fire a rule in ascending rank order, you can write (using<br>
>> modified Drools syntax)<br>>><br>>> rule "fire in rank order 1,2,..."<br>>> when<br>>> Element( $rank : rank,... )<br>>> // ...<br>>> salience -$rank ### <=<br>
>> then<br>>> // ...<br>>> end<br>>><br>>> The dynamically set salience does all the work. (Of course, you can<br>>> achieve the same order<br>>> in Drools easily enough.)<br>
>><br>>> This is possible since salience is a value that must be carried over<br>>> into the activation.<br>>> There is at least one other rule attribute that shares this property,<br>>> but I'm not sure<br>
>> whether anything useful can be done with dynamic agenda groups.<br>>><br>>> Cheers<br>>> -W<br>>> _______________________________________________<br>>> rules-dev mailing list<br>>> <a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>><br>><br>><br>> --<br>> Edson Tirelli<br>> JBoss Drools Core Development<br>
> JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>><br>> _______________________________________________<br>> rules-dev mailing list<br>> <a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>><br>><br><br>
</div></div><br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Abraços<br>Raphael Duarte Paiva<br>Graduando em Ciência da Computação<br><br>"For millions of years, mankind lived just like the animals. Then something happened which unleashed the power of our imagination. We learned to talk [...]" - Stephen Hawking, 1993<br>