cancel
Showing results for 
Search instead for 
Did you mean: 

Error in calling action strategy

former_member674349
Participant
0 Kudos

Hi Expert,

in custom promotion Strategies are not getting called.

     <property name="key" value="defaultRuleProductPriceQuantityRAOAction" />
     <property name="value" ref="defaultpriceQuantityActionStrategy" />
 </bean>

getting below error

suggest way to handle this

Stack Trace : ERROR [hybrisHTTP38] [DefaultCommerceRuleEngineService] Possible rule-loop detected. Maximum allowed rule matches has been exceeded. Current Limit:10 11:986d721a-ce92-41bf-81c8-ad9c9d82dab6 You can adjust or disable the limit for rule matches by changing the ruleFiringLimit field in the 'Drools Engine Context' object (see the 'Rule Firing Limit' attribute).

ERROR [hybrisHTTP38] [DefaultPromotionEngineService] Possible rule-loop detected. Maximum allowed rule matches has been exceeded. Current Limit:10 11:986d721a-ce92-41bf-81c8-ad9c9d82dab6 You can adjust or disable the limit for rule matches by changing the ruleFiringLimit field in the 'Drools Engine Context' object (see the 'Rule Firing Limit' attribute).

de.hybris.platform.ruleengine.exception.DroolsRuleLoopException: Possible rule-loop detected. Maximum allowed rule matches has been exceeded. Current Limit:10 11:986d721a-ce92-41bf-81c8-ad9c9d82dab6 You can adjust or disable the limit for rule matches by changing the ruleFiringLimit field in the 'Drools Engine Context' object (see the 'Rule Firing Limit' attribute).

     at de.hybris.platform.ruleengine.impl.RuleMatchCountListener.afterMatchFired(RuleMatchCountListener.java:44) ~[ruleengineserver.jar:?]
     at org.drools.core.event.AgendaEventSupport.fireAfterActivationFired(AgendaEventSupport.java:98) ~[drools-core-6.3.0.Final.jar:6.3.0.Final]
     at org.drools.core.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1114) ~[drools-core-6.3.0.Final.jar:6.3.0.Final]
     at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:121) ~[drools-core-6.3.0.Final.jar:6.3.0.Final]
     at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:74) ~[drools-core-6.3.0.Final.jar:6.3.0.Final]
     at org.drools.core.common.Default

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

The error you are getting is a safety mechanism provided by the hybris ruleengine to prevent endless loops which can happen quite easily in drools (and cannot be prevented or predicted by just analyzing the rules). It must have been modified to "10" as the default value (in the impex files provided out of the box) is usually 200.

This just means that as soon as more than 10 rules have fired during the course of one rule evaluation (e.g. an evaluation of a cart for applicable promotions), the rule engine will abort assuming that there is an endless loop. So if your use case allows for more than 10 rules to be fired, you should increase the ruleFiringLimit to a higher value (it is defined on the DroolsRuleContext.ruleFiringLimit property).

If you continue getting this error, there is a good chance that one (or more) of your drools rules keep triggering itself (or each other) endlessly. In the simple case it could just be one rule that keeps on triggering itself again. In a more complex scenario it could be e.g. that the action of rule1 triggers rule2, rule2 action triggers rule3, rule3 action triggers rule1 again which will then trigger rule 2 again etc.

Do you have many rules in your system?

Are they manually written drools rules or are you using the rule builder?

Could you provide the drl content (the drools code) here to help analyze what is going on? You should find the drl in the backoffice under Rule Engine -> Drools Rules in the Rule Content field.

Hope this helps,

Sebastian

Answers (3)

Answers (3)

eatamanenco
Explorer
0 Kudos

Met such error message: "[DefaultCommerceRuleEngineService] Possible rule-loop detected. Maximum allowed rule matches has been exceeded." after Hybris upgrade from version 6.7 -> 18.08.

As a solution in this case - all currently active rules must be recompiled (i.e. publish all Published rules).

preetiramdas
Discoverer
0 Kudos

We are facing the same issue. Please let us know a resolution

0 Kudos

HI ,

Thanks for your reply. We have few Drools Rule present in the system but one is not calling the other rule. We have noticed that the moment, we make any changes in the promotion Rule and publish it, the rule stops working on storefront. The Drool content has a heading which says the rule needs deployment after changes. What does it mean? How do we deploy the changes on the fly? If we restart the server, the promotions starts working. Any pointers would be highly appreciated. Thanks.

0 Kudos

I believe the process is to make changes to Promotion Rule, publish it. Go to Drools Rule and then redeploy the changes. Is that correct?

0 Kudos

Hi Ravi/Jayant,

I am facing the same issue.Could you please provide the resolution for the same.

Thanks & Regards,