Esempio n. 1
0
 /**
  * Returns a customer event object with the action and customer id attributes populated. If events
  * aren't enabled, then null is returned.
  *
  * @param kkAppEng App eng instance
  * @param action Event action
  * @return Returns a customer event object or null if events aren't enabled
  */
 protected CustomerEventIf getCustomerEvent(KKAppEng kkAppEng, int action) {
   String enabled = kkAppEng.getConfig(ConfigConstants.ENABLE_CUSTOMER_EVENTS);
   if (enabled != null && enabled.equalsIgnoreCase("true")) {
     CustomerEventIf event = new CustomerEvent();
     event.setAction(action);
     CustomerIf currentCust = kkAppEng.getCustomerMgr().getCurrentCustomer();
     if (currentCust != null) {
       event.setCustomerId(currentCust.getId());
     }
     return event;
   }
   return null;
 }