<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'>If it works with salience, why change ?<br>And why is the order so important ? Still trying to get the first occurence of an event of a given type/value ?<br>It remembers me some not-so-old post ...<br><br><hr id="zwchr"><div style="color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>De: </b>"salt" &lt;writemesaltworth@gmail.com&gt;<br><b>À: </b>rules-users@lists.jboss.org<br><b>Envoyé: </b>Mardi 4 Septembre 2012 06:17:16<br><b>Objet: </b>[rules-users] Without salience<br><br><br>Hi All,<br><br>For the below use case i have implemented the rule. Please suggest other way<br>of doing without salience.<br><br>scenario<br><br>ITEMS &nbsp; &nbsp;AMOUNT &nbsp;OCCNO<br><br>PASS &nbsp; &nbsp; &nbsp;10 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1<br><br>FAIL &nbsp; &nbsp; &nbsp;10 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2<br><br>PASS &nbsp; &nbsp; &nbsp;15 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3<br><br>PASS &nbsp; &nbsp; &nbsp;25 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4<br><br><br>rule "HelloWorld_14"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;salience (65522- $list.indexOf( $transdet1 ))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$p1:Passes($list : transaction)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$trans1:Transaction(items in ("PASS")) from $list<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$p2:Passes()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;not(exists($transdet5:Transaction(items in<br>("FAIL"),value==$transdet1.getVaue(), occno&gt;$trans1.getOccno()) from<br>$p2.transaction))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println($trans1.getOccno());<br>end<br><br>The above will return <br><br>3<br><br>4 &nbsp; (not 4,3)<br><br>Kindly suggest other way of doing this without salience.<br><br><br>Thanks<br>Salt<br><br><br><br>--<br>View this message in context: http://drools.46999.n3.nabble.com/Without-salience-tp4019565.html<br>Sent from the Drools: User forum mailing list archive at Nabble.com.<br>_______________________________________________<br>rules-users mailing list<br>rules-users@lists.jboss.org<br>https://lists.jboss.org/mailman/listinfo/rules-users<br></div><br></div></body></html>