public class PromotionEngineServicesKeywordLibrary extends AbstractKeywordLibrary
| Constructor and Description |
|---|
PromotionEngineServicesKeywordLibrary() |
| Modifier and Type | Method and Description |
|---|---|
void |
addProductToCart(ProductModel product,
java.lang.String cartId) |
void |
checkOrderNotUsesCoupon(java.lang.String cartId,
java.lang.String couponCode) |
void |
checkOrderUsesCoupon(java.lang.String cartId,
java.lang.String couponCode) |
void |
checkProductQuantity(ProductModel product,
java.lang.String cartId,
int quantity) |
void |
checkThatDeliveryModeNotDefined(java.lang.String cartId) |
void |
checkThatPriceLessThanFor(java.math.BigDecimal beforePromoPrice,
java.math.BigDecimal afterPromoPrice,
java.lang.String expectedDifferenceValue) |
protected void |
compileAndDeployRule(java.lang.String ruleCode,
java.lang.String moduleName,
boolean enableIncrementalUpdate) |
void |
compileRuleIncrementally(java.lang.String ruleCode,
java.lang.String moduleName) |
void |
compileSourceRule(java.lang.String ruleCode,
java.lang.String moduleName) |
void |
compileSourceRules(java.lang.String ruleCodes,
java.lang.String moduleName) |
CartModel |
createCart(java.lang.String cartId) |
CartModel |
createCart(java.lang.String cartId,
java.lang.String currency) |
void |
createEntryGroupForCart(int groupNumber,
java.lang.String groupType,
java.lang.String cartId) |
java.math.BigDecimal |
evaluatePromotionForCart(java.lang.String cartId) |
AbstractRuleActionRAO |
evaluatePromotionForProduct(ProductModel product) |
protected CartModel |
getCartByCode(java.lang.String code) |
CategoryModel |
getCategory(java.lang.String categoryCode) |
protected RuleEngineService |
getCommerceRuleEngineService() |
protected CouponService |
getCouponService() |
java.lang.String |
getDeliveryModeForCart(java.lang.String cartId) |
java.util.Optional<DroolsKIEBaseModel> |
getDroolsKieBase(java.lang.String baseName) |
protected DroolsKIEBaseDao |
getDroolsKIEBaseDao() |
protected EngineRuleDao |
getEngineRuleDao() |
protected FlexibleSearchService |
getFlexibleSearchService() |
protected MediaService |
getMediaService() |
protected ModelService |
getModelService() |
protected PriceService |
getPriceService() |
ProductModel |
getProduct(java.lang.String productCode)
Provides product model for with given product code
|
java.math.BigDecimal |
getProductPrice(ProductModel productModel) |
java.math.BigDecimal |
getProductPriceWithPromotion(ProductModel productModel,
DiscountRAO discount) |
java.math.BigDecimal |
getProductTotalFromCart(java.lang.String productId,
java.lang.String cartId) |
java.util.List<AbstractPromotionActionModel> |
getPromotionActionsForCart(CartModel cartModel) |
protected PromotionEngineService |
getPromotionEngineService() |
protected RuleActionService |
getRuleActionService() |
protected RuleCompilerService |
getRuleCompilerService() |
protected RuleEngineContextDao |
getRuleEngineContextDao() |
protected RuleService |
getRuleService() |
AbstractRulesModuleModel |
getRulesModule(java.lang.String moduleName) |
protected RulesModuleDao |
getRulesModuleDao() |
protected java.util.List<PromotionGroupModel> |
getTestPromoGroups() |
protected DroolsKIEModuleModel |
getTestRulesModule(java.util.Set<DroolsRuleModel> rules) |
java.math.BigDecimal |
getTotalOfCart(java.lang.String cartId) |
protected UserService |
getUserService() |
protected PriceInformation |
getWebPriceForProduct(ProductModel product) |
RuleEngineActionResult |
initializeRuleEngineWithRuleFromAndMaxAllowedRuns(java.lang.String rulesFileName,
int maxAllowedRuns) |
protected RuleEngineActionResult |
initializeRuleEngineWithRules(java.util.Map<java.lang.String,java.lang.String> ruleName2media) |
RuleEngineActionResult |
initializeRuleEngineWithRulesFrom(java.lang.String rulesFileNames) |
protected void |
logAppliedPromotions(CartModel cart) |
protected void |
logCartDetails(CartModel cart) |
protected void |
logModuleInitialization(InitializationFuture initializationFuture) |
protected boolean |
orderUsesCoupon(java.lang.String cartId,
java.lang.String couponCode) |
protected java.lang.String |
readRuleFile(java.lang.String fileName) |
void |
redeemCouponWithCodeForCart(java.lang.String couponCode,
java.lang.String cartId) |
void |
releaseCouponWithCodeForCart(java.lang.String couponCode,
java.lang.String cartId) |
void |
removeOneItemOfProduct(ProductModel product,
java.lang.String cartId) |
void |
removeProduct(ProductModel product,
java.lang.String cartId) |
void |
setCartToUser(java.lang.String userUID,
java.lang.String cartId) |
protected void |
setCouponService(CouponService couponService) |
void |
setCurrentSite() |
void |
setDeliveryModeForCart(java.lang.String cartId,
java.lang.String deliveryModeCode) |
protected void |
setGlobals(DroolsRuleModel rule) |
protected void |
setRuleActionService(RuleActionService ruleActionService) |
void |
updateCartEntryWithGroupNumber(int entryNumber,
int entryGroupNumber,
java.lang.String cartId) |
void |
updateCartQuantity(int entryNo,
long quantity,
java.lang.String cartId) |
boolean |
verifyCartHasNotPromotionActionType(java.lang.String cartId,
java.lang.String promotionActionType) |
void |
verifyPromotionActionByType(java.lang.String cartId,
java.lang.String promotionActionType) |
public PromotionEngineServicesKeywordLibrary()
public RuleEngineActionResult initializeRuleEngineWithRuleFromAndMaxAllowedRuns(java.lang.String rulesFileName, int maxAllowedRuns) throws java.io.IOException
java.io.IOExceptionpublic RuleEngineActionResult initializeRuleEngineWithRulesFrom(java.lang.String rulesFileNames) throws java.io.IOException
java.io.IOExceptionpublic CartModel createCart(java.lang.String cartId, java.lang.String currency)
public CartModel createCart(java.lang.String cartId)
public void addProductToCart(ProductModel product, java.lang.String cartId)
public void removeProduct(ProductModel product, java.lang.String cartId) throws CalculationException
CalculationExceptionpublic void removeOneItemOfProduct(ProductModel product, java.lang.String cartId) throws CalculationException
CalculationExceptionpublic void updateCartQuantity(int entryNo,
long quantity,
java.lang.String cartId)
throws CalculationException
CalculationExceptionpublic void updateCartEntryWithGroupNumber(int entryNumber,
int entryGroupNumber,
java.lang.String cartId)
public void createEntryGroupForCart(int groupNumber,
java.lang.String groupType,
java.lang.String cartId)
protected CartModel getCartByCode(java.lang.String code)
public java.math.BigDecimal getTotalOfCart(java.lang.String cartId)
throws CalculationException
CalculationExceptionprotected java.lang.String readRuleFile(java.lang.String fileName)
throws java.io.IOException
java.io.IOExceptionprotected RuleEngineActionResult initializeRuleEngineWithRules(java.util.Map<java.lang.String,java.lang.String> ruleName2media)
protected java.util.List<PromotionGroupModel> getTestPromoGroups()
protected void setGlobals(DroolsRuleModel rule)
protected DroolsKIEModuleModel getTestRulesModule(java.util.Set<DroolsRuleModel> rules)
public java.math.BigDecimal evaluatePromotionForCart(java.lang.String cartId)
protected void logCartDetails(CartModel cart)
protected void logAppliedPromotions(CartModel cart)
public java.lang.String getDeliveryModeForCart(java.lang.String cartId)
public void setDeliveryModeForCart(java.lang.String cartId,
java.lang.String deliveryModeCode)
public AbstractRuleActionRAO evaluatePromotionForProduct(ProductModel product)
public ProductModel getProduct(java.lang.String productCode)
productCode - product codepublic CategoryModel getCategory(java.lang.String categoryCode)
public java.math.BigDecimal getProductPrice(ProductModel productModel)
public java.math.BigDecimal getProductPriceWithPromotion(ProductModel productModel, DiscountRAO discount)
public void checkProductQuantity(ProductModel product, java.lang.String cartId, int quantity)
public void checkThatPriceLessThanFor(java.math.BigDecimal beforePromoPrice,
java.math.BigDecimal afterPromoPrice,
java.lang.String expectedDifferenceValue)
public void checkThatDeliveryModeNotDefined(java.lang.String cartId)
public void setCartToUser(java.lang.String userUID,
java.lang.String cartId)
protected PriceInformation getWebPriceForProduct(ProductModel product)
public void compileRuleIncrementally(java.lang.String ruleCode,
java.lang.String moduleName)
public void compileSourceRule(java.lang.String ruleCode,
java.lang.String moduleName)
protected void compileAndDeployRule(java.lang.String ruleCode,
java.lang.String moduleName,
boolean enableIncrementalUpdate)
public void compileSourceRules(java.lang.String ruleCodes,
java.lang.String moduleName)
protected void logModuleInitialization(InitializationFuture initializationFuture)
public void redeemCouponWithCodeForCart(java.lang.String couponCode,
java.lang.String cartId)
public void releaseCouponWithCodeForCart(java.lang.String couponCode,
java.lang.String cartId)
public void checkOrderUsesCoupon(java.lang.String cartId,
java.lang.String couponCode)
public void checkOrderNotUsesCoupon(java.lang.String cartId,
java.lang.String couponCode)
protected boolean orderUsesCoupon(java.lang.String cartId,
java.lang.String couponCode)
public java.math.BigDecimal getProductTotalFromCart(java.lang.String productId,
java.lang.String cartId)
public void verifyPromotionActionByType(java.lang.String cartId,
java.lang.String promotionActionType)
public boolean verifyCartHasNotPromotionActionType(java.lang.String cartId,
java.lang.String promotionActionType)
public java.util.List<AbstractPromotionActionModel> getPromotionActionsForCart(CartModel cartModel)
public java.util.Optional<DroolsKIEBaseModel> getDroolsKieBase(java.lang.String baseName)
public AbstractRulesModuleModel getRulesModule(java.lang.String moduleName)
public void setCurrentSite()
protected ModelService getModelService()
protected RuleEngineService getCommerceRuleEngineService()
protected PromotionEngineService getPromotionEngineService()
protected FlexibleSearchService getFlexibleSearchService()
protected PriceService getPriceService()
protected RuleEngineContextDao getRuleEngineContextDao()
protected RuleActionService getRuleActionService()
protected void setRuleActionService(RuleActionService ruleActionService)
protected MediaService getMediaService()
protected UserService getUserService()
protected RuleService getRuleService()
protected RuleCompilerService getRuleCompilerService()
protected EngineRuleDao getEngineRuleDao()
protected CouponService getCouponService()
protected void setCouponService(CouponService couponService)
protected DroolsKIEBaseDao getDroolsKIEBaseDao()
protected RulesModuleDao getRulesModuleDao()
Copyright © 2018 SAP SE. All Rights Reserved.