cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

more than one rule module found

Former Member
0 Kudos
1,975

Hello,

I am getting the below error for promotions..

ERROR [hybrisHTTP22] [DefaultPromotionEngineService] Promotion rule evaluation failed java.lang.IllegalStateException: Cannot determine unique rule engine context for rule evaluation: More than one Rules Modules (promotions-module, promotions-preview-module) found for type PROMOTION

If I go and see in the back office marketing tab --> promotion module has promotions-module and promotions-preview-module without catalog version. When I click on the module I see the catalog version field is not editable.

How do I make the above modules one staged (promotions-preview-module) and other one (promotions-module) is online so that the promotions will work.

Is there an impex that I need to run for the modules so that one will be staged and another one will be online?

I see OOTB we have those 2 modules and one of them has online catalog version and another one is staged catalog version.

Any help would be appreciated what impex need to run to resolve the above error.

While setting up the store front most of the impex's related to promotions are deleted. Now I need some direction to figure out what are all the impex's need to run for the promotions to work again.

Where can I find all the impex's related promotions and which one need to run again to work the promotions.

Accepted Solutions (0)

Answers (6)

Answers (6)

0 Kudos

Only this line worked for me for the same issue. Thanks

INSERT_UPDATE CatalogVersionToRuleEngineContextMapping;context(name)[unique=true];catalogVersion(catalog(id),version)[unique=true] ;promotions-context;electronicProductCatalog:Online ;promotions-preview-context;electronicProductCatalog:Staged

Former Member
0 Kudos

Hi, does the solutions worked for anyone?

Former Member
0 Kudos

Run below Impex

#Creates a secondary promotion module named eg: promotions-preview-module with initial version number INSERT_UPDATE DroolsKIEModule;name[unique=true];mvnGroupId;mvnArtifactId;mvnVersion;ruleType(code);active;version; ;promotions-preview-module;hybris-rules;promotions-preview;1.0.0;PROMOTION;true;-1; #Create KIE Base associated with newly created KIE Module INSERT_UPDATE DroolsKIEBase;name[unique=true];kieModule(name)[unique=true];equalityBehavior(code);eventProcessingMode(code) ;promotions-preview-base;promotions-preview-module;EQUALITY;STREAM #Create KIE Session and associated with newly created KIE Base INSERT_UPDATE DroolsKIESession;name[unique=true];kieBase(name)[unique=true];sessionType(code) ;promotions-preview-session;promotions-preview-base;STATELESS #Combine KIE Module with Default KIE Base UPDATE DroolsKIEModule;name[unique=true];defaultKIEBase(name) ;promotions-preview-module;promotions-preview-base #Combine KIE Base with Default KIE Session UPDATE DroolsKIEBase;name[unique=true];defaultKIESession(name) ;promotions-preview-base;promotions-preview-session #Associate KIE Session With Rule Engine Context INSERT_UPDATE DroolsRuleEngineContext;name[unique=true];kieSession(name);ruleFiringLimit ;promotions-preview-context;promotions-preview-session;200; INSERT_UPDATE CatalogVersionToRuleEngineContextMapping;context(name)[unique=true];catalogVersion(catalog(id),version)[unique=true] ;promotions-context;electronicProductCatalog:Online ;promotions-preview-context;electronicProductCatalog:Staged

Former Member
0 Kudos

Run following Impex

Creates a secondary promotion module named eg: promotions-preview-module with initial version number

NSERT_UPDATE DroolsKIEModule;name[unique=true];mvnGroupId;mvnArtifactId;mvnVersion;ruleType(code);active;version; ;promotions-preview-module;hybris-rules;promotions-preview;1.0.0;PROMOTION;true;-1;

Create KIE Base associated with newly created KIE Module

NSERT_UPDATE DroolsKIEBase;name[unique=true];kieModule(name)[unique=true];equalityBehavior(code);eventProcessingMode(code) ;promotions-preview-base;promotions-preview-module;EQUALITY;STREAM

Create KIE Session and associated with newly created KIE Base

NSERT_UPDATE DroolsKIESession;name[unique=true];kieBase(name)[unique=true];sessionType(code) ;promotions-preview-session;promotions-preview-base;STATELESS

Combine KIE Module with Default KIE Base

PDATE DroolsKIEModule;name[unique=true];defaultKIEBase(name) ;promotions-preview-module;promotions-preview-base

Combine KIE Base with Default KIE Session

PDATE DroolsKIEBase;name[unique=true];defaultKIESession(name) ;promotions-preview-base;promotions-preview-session

Associate KIE Session With Rule Engine Context

NSERT_UPDATE DroolsRuleEngineContext;name[unique=true];kieSession(name);ruleFiringLimit ;promotions-preview-context;promotions-preview-session;200;

INSERT_UPDATE CatalogVersionToRuleEngineContextMapping;context(name)[unique=true];catalogVersion(catalog(id),version)[unique=true] ;promotions-context;electronicProductCatalog:Online ;promotions-preview-context;electronicProductCatalog:Staged

Former Member
0 Kudos

Thanks for your reply. I know there is an issue with the impex. Your answer didn't help me in any direction to analyze the issue.

Former Member
0 Kudos

Hi ,

Problem that you describe is peek of an bigger issue.

Two versions mechanism (staged and online) and synchronisation might be core of all mess. When synchronisation occurs, all online data is overwritten by staged data. Thus it is advisable to commit every change in staged version. It might be root of losing most of the impex's related to promotions during storefront set up.

Module promotions-preview-module is meant to be staged. Module promotions-module is meant to be online.

Error occurred probably because ImpEx query was lacking destination (module).

Regards,