Advertisement
Guest User

def promoService

a guest
Feb 8th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.93 KB | None | 0 0
  1. def promoService() {
  2.     // j'ai du mal à déclarer une map avec le groovy :
  3.     Map serviceCtx = (parameters.productPromoCond , parameters.shoppingCart, nowTimestamp)
  4.     try {
  5.         Map condResult = dispatcher.runSync(condValue, serviceCtx)
  6.     } catch (GenericServiceException e) {
  7.         Debug.logError(e, "Fatal error calling promo condition check service [" + condValue + "]", module)
  8.         return false
  9.     }
  10.     if (ServiceUtil.isError(condResult)) {
  11.         Debug.logError("Error calling calling promo condition check service [" + condValue + "]", module)
  12.         return false
  13.     }
  14.     Boolean directResult = (Boolean) condResult.get("directResult")
  15.     if (directResult != null) {
  16.         return directResult.booleanValue()
  17.     }
  18.     compareBase = (Integer) condResult.get("compareBase")
  19.     if (condResult.containsKey("operatorEnumId")) {
  20.         operatorEnumId = (String) condResult.get("operatorEnumId")
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement