[rules-users] Problem with salience

jmolly jmolly at gmail.com
Thu Jul 7 10:35:50 EDT 2011


Hello.
I'm facing some problems in drools with salience. (maybe I don't understand
how it works)

We have a rule that check if an import has been satisfied by the client. But
we have a lot of pay methods so, when the import has been satisfied, we have
to stop all the payment devices. If a payment device is in use, we can't
stop it, so we send stop commands until device can stop.
The problem is that if a device is making a pay process, and consumes an
event, that event is never fired.

Maybe I can explain better with code:


rule "Pay device stop"
Salience 10
Try to stop the device and sends an OPERATION_IN event if can't stop
(because there is a ticket inside)

Machine rule 
rule "Operation in received witch devices not stopped"
salience 10
   Sent stop events to all devices

Machine rule
rule "Operation in received with devices stopped"
salience 10
    All ok. Finish operation


rule "Ticket data read"
salience 1000
  updates the debt for the user and sends an OPERATION_IN

The pay hardware, when is reading a ticket, sent a TICKET_DATA_READ
this rule has salience 100 and should be fired inmediatly but Drools is
entering all time in a bucle from Operation in received and Pay stop device.


Can someone give a clue about what are we doing wrong?


Sorry for the english. I can post the original code if needed.
Thanks in advance










--
View this message in context: http://drools.46999.n3.nabble.com/Problem-with-salience-tp3148382p3148382.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list