If it works with salience, why change ?
And why is the order so important ? Still trying to get the first occurence of an event of a given type/value ?
It remembers me some not-so-old post ...


De: "salt" <writemesaltworth@gmail.com>
À: rules-users@lists.jboss.org
Envoyé: Mardi 4 Septembre 2012 06:17:16
Objet: [rules-users] Without salience


Hi All,

For the below use case i have implemented the rule. Please suggest other way
of doing without salience.

scenario

ITEMS    AMOUNT  OCCNO

PASS      10          1

FAIL      10            2

PASS      15           3

PASS      25           4


rule "HelloWorld_14"
        salience (65522- $list.indexOf( $transdet1 ))
        when
                
                $p1:Passes($list : transaction)
                $trans1:Transaction(items in ("PASS")) from $list
                $p2:Passes()
                not(exists($transdet5:Transaction(items in
("FAIL"),value==$transdet1.getVaue(), occno>$trans1.getOccno()) from
$p2.transaction))
        then
                System.out.println($trans1.getOccno());
end

The above will return

3

4   (not 4,3)

Kindly suggest other way of doing this without salience.


Thanks
Salt



--
View this message in context: http://drools.46999.n3.nabble.com/Without-salience-tp4019565.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users