[rules-users] Drools Salience and no-loop

gboro54 gboro54 at gmail.com
Fri Mar 9 08:58:25 EST 2012


So I have setup my drools execution as follows:
  1.A single thread is pooling Orders from the db and insert them into X
number of sessions(10) running on separate threads(fireUntilHalt()). 

  2. I have a set up rules which need to execute first to allow other rules
to fire so I have rules such as:
      rule "main 1"
          salience 1000
          no-loop true
          when
               <some_conditions>
           then
               <modify order info>(update is invoked)
     end

   3. There is another set of rules which then check the Order for these
preconditions along with others
       rule "sub 1"
          salience 100
          no-loop true
          when
               <some_conditions>
               <main 1 consequences present>
           then
               <modify order info>(no update invoked as other rules in the
session don't care) 
     end

   4. I then have a single rule which has a low salience and should be last
rule to fire in the activation which retracts the Order and hands it to a
service for post processsing
       rule "END"
          salience -100
          no-loop true
          when
               ord:Order
           then
               retract(ord);
               invokeService(ord);
     end
 

The problem I am having is that my END rule is being invoked on certain
Orders in working memory before the other activation have taken any affect(I
have verified this by send a replicated order 1000 times and each time a
large majority his the service before anything was modified on the order). 

Am I missing something? 

--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Salience-and-no-loop-tp3812723p3812723.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list