Loading
Get Started with Communications, Media, and Energy & Utilities (CME)...
CtxRulesPromotionsOpenImplementation

CtxRulesPromotionsOpenImplementation

Gets the qualified promotions based on the current context and the rule sets defined for a set of promotions.

Interface

VlocityOpenInterface

Sample Code

// now run the context rules
Map<String, Object> ctxSvcinput = new Map<String,Object>();
Map<String, Object> ctxSvcoption = new Map<String,Object>();
Map<String, Object> ctxSvcoutput = new Map<String,Object>();
ctxSvcinput.put('ObjectList', appliedPromotions);
ctxSvcinput.put('OrderId', cartId);
CtxRulesPromotionsOpenImplementation ctxPromoSvc = new CtxRulesPromotionsOpenImplementation();
ctxPromoSvc.doEligiblePromotions(ctxSvcinput, ctxSvcoutput, ctxSvcoption);
if(ctxSvcoutput.get('PassList') != null)
qualifiedPromoList.addAll((List<Object>)ctxSvcoutput.get('PassList'));
if(ctxSvcoutput.get('HardFailList') != null)
disqualifiedPromoList.addAll((List<Object>)ctxSvcoutput.get('HardFailList'));
if(ctxSvcoutput.get('SoftFailList') != null)
disqualifiedPromoList.addAll((List<Object>)ctxSvcoutput.get('SoftFailList'));
if(ctxSvcoutput.get('SoftPassList') != null)
disqualifiedPromoList.addAll((List<Object>)ctxSvcoutput.get('SoftPassList'));

Related Implementations

None

 
Loading
Salesforce Help | Article