[rules-users] Problem with salience

Wolfgang Laun wolfgang.laun at gmail.com
Thu Jul 7 11:57:07 EDT 2011


Sorry, but I become more confused with every re-read. I think the original
code is required.

I think that this is nothing but a FSM. Generally, this sort of problem
should be doable without resorting to salience (except for one or two low
priority ones acting as the "safety net").

-W



On 7 July 2011 16:35, jmolly <jmolly at gmail.com> wrote:

> 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.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110707/796eab41/attachment.html 


More information about the rules-users mailing list