Class DefaultTravelDroolsService

java.lang.Object
de.hybris.platform.travelrulesengine.services.impl.AbstractTravelEngineService
de.hybris.platform.travelrulesengine.services.impl.DefaultTravelDroolsService
All Implemented Interfaces:
TravelEngineService, TravelRulesService

public class DefaultTravelDroolsService extends AbstractTravelEngineService implements TravelRulesService
Drools implementation for the rules service interface TravelRulesService
  • Constructor Details

    • DefaultTravelDroolsService

      public DefaultTravelDroolsService()
  • Method Details

    • evaluateCart

      public List<CartEntryModel> evaluateCart(CartModel cart)
      Description copied from interface: TravelRulesService
      Method to evaluate cart with rules to add fees and discounts.
      Specified by:
      evaluateCart in interface TravelRulesService
      Parameters:
      cart - the cart
      Returns:
      cart entry
    • getTotalFee

      public double getTotalFee()
      Description copied from interface: TravelRulesService
      Method to get total fee eg:admin fee after evaluating the rules.
      Specified by:
      getTotalFee in interface TravelRulesService
      Returns:
      total fee
    • getRefundAction

      public RefundActionType getRefundAction(OrderModel orderModel)
      Description copied from interface: TravelRulesService
      Method to get refund action after rules evaluation
      Specified by:
      getRefundAction in interface TravelRulesService
      Parameters:
      orderModel - the order model
      Returns:
      refund action type
    • filterActions

      protected <T> void filterActions(RuleEngineResultRAO resultRAO, Class<T> type)
      Method to filter actions.
      Type Parameters:
      T - the type parameter
      Parameters:
      resultRAO - the result rao
      type - the type
    • filterFareProducts

      public List<FareProductData> filterFareProducts(List<FareProductData> fareProducts, FareSearchRequestData fareSearchRequest)
      Description copied from interface: TravelRulesService
      Method to filter out the fare products that match rules
      Specified by:
      filterFareProducts in interface TravelRulesService
      Parameters:
      fareProducts - the fare products
      fareSearchRequest - the fare search request
      Returns:
      list of fare products excluded by rules evaluation
    • filterBundles

      @Deprecated public List<String> filterBundles(FareSearchRequestData fareSearchRequestData, UserModel currentUser)
      Deprecated.
      since version 4.0
      Returns the list of bundle templates that needs to be filtered from the search result
      Specified by:
      filterBundles in interface TravelRulesService
      Parameters:
      fareSearchRequestData - the fare search request data
      currentUser - the current user
      Returns:
    • showBundleTemplates

      public List<String> showBundleTemplates(FareSearchRequestData fareSearchRequestData)
      Description copied from interface: TravelRulesService
      Method to show bundle templates returned from rule evaluation
      Specified by:
      showBundleTemplates in interface TravelRulesService
      Parameters:
      fareSearchRequestData - the fare search request data
      Returns:
      list of bundle templates returned from rules evaluation
    • showProducts

      public List<String> showProducts(OfferRequestData offerRequestData)
      Description copied from interface: TravelRulesService
      Method to show products returned after evaluating rules
      Specified by:
      showProducts in interface TravelRulesService
      Parameters:
      offerRequestData - the offer request data
      Returns:
      list of product codes to be shown as per the rules
    • collectShowProductsResult

      protected void collectShowProductsResult(List<ShowProductActionResultModel> showProductActionResults, List<ItemModel> showResults)
      Collect show products result.
      Parameters:
      showProductActionResults - the show product action results
      showResults - the show results
    • showProductCategories

      public List<String> showProductCategories(OfferRequestData offerRequestData)
      Description copied from interface: TravelRulesService
      Method to show product categories returned after evaluating rules
      Specified by:
      showProductCategories in interface TravelRulesService
      Parameters:
      offerRequestData - the offer request data
      Returns:
      list of product codes to be shown as per the rules
    • collectProductCategoriesResult

      protected void collectProductCategoriesResult(List<ShowProductCategoryActionResultModel> showProductCategoriesActionResults, List<ItemModel> showResults)
      This method collects product categories show result
      Parameters:
      showProductCategoriesActionResults - the show product categories action results
      showResults - the show results
    • showExtraProducts

      public List<String> showExtraProducts(AccommodationReservationData reservationData)
      Description copied from interface: TravelRulesService
      Show extra products list.
      Specified by:
      showExtraProducts in interface TravelRulesService
      Parameters:
      reservationData - the reservation data
      Returns:
      the list
    • collectShowExtraProductsResult

      protected void collectShowExtraProductsResult(List<ShowExtraProductActionResultModel> showProductActionResults, List<ItemModel> showResults)
      Collect show extra products result.
      Parameters:
      showProductActionResults - the show product action results
      showResults - the show results
    • showAccommodationOfferings

      public List<String> showAccommodationOfferings(AccommodationSearchResponseData accommodationSearchResponseData)
      Description copied from interface: TravelRulesService
      Show accommodation offerings.
      Specified by:
      showAccommodationOfferings in interface TravelRulesService
      Parameters:
      accommodationSearchResponseData - the accommodation search response data
      Returns:
      the list
    • showAccommodationCategories

      public List<String> showAccommodationCategories(AccommodationAvailabilityRequestData availabilityRequestData)
      Description copied from interface: TravelRulesService
      Show accommodation categories list.
      Specified by:
      showAccommodationCategories in interface TravelRulesService
      Parameters:
      availabilityRequestData - the availability request data
      Returns:
      the list
    • collectAccommodationCategories

      protected void collectAccommodationCategories(List<ShowAccommodationCategoryActionResultModel> showAccommodationCategoryActionResultModels, List<ItemModel> showResults)
      Collect accommodation categories.
      Parameters:
      showAccommodationCategoryActionResultModels - the show accommodation category action result models
      showResults - the show results
    • collectAccommodationOfferingsResult

      protected void collectAccommodationOfferingsResult(List<ShowAccommodationOfferingActionResultModel> showAccommodationOfferingActionResults, List<ItemModel> showResults)
      Collect show accommodation offerings result.
      Parameters:
      showAccommodationOfferingActionResults - the show accommodation offering action results
      showResults - the show results
    • showRatePlans

      public List<String> showRatePlans(AccommodationAvailabilityRequestData availabilityRequestData, RoomStayData roomStayData)
      Description copied from interface: TravelRulesService
      Show Rate Plans.
      Specified by:
      showRatePlans in interface TravelRulesService
      Parameters:
      availabilityRequestData - the accommodation availability request data
      roomStayData - the room stay data
      Returns:
      the list of rate plans
    • collectRatePlansResult

      protected void collectRatePlansResult(List<ShowRatePlanActionResultModel> showRatePlanActionResults, List<ItemModel> showResults)
      Collect show rate plans result.
      Parameters:
      showRatePlanActionResults - the show rate plan action results
      showResults - the list of results
    • showAccommodations

      public List<String> showAccommodations(AccommodationAvailabilityRequestData availabilityRequestData, RoomStayData roomStayData)
      Description copied from interface: TravelRulesService
      Show accommodations list.
      Specified by:
      showAccommodations in interface TravelRulesService
      Parameters:
      availabilityRequestData - the accommodation availability request data
      roomStayData - the room stay data
      Returns:
      the list
    • collectAccommodations

      protected void collectAccommodations(List<ShowAccommodationActionResultModel> showAccommodationActionResultModel, List<ItemModel> showResults)
      Collect accommodations.
      Parameters:
      showAccommodationActionResultModel - the show accommodation action result model
      showResults - the show results
    • createCart

      protected CartModel createCart()
      Method to create a dummy cart. This is used to validate the admin fee rule which expects a cart by default.
      Returns:
      cart cart model
    • findFareProduct

      protected FareProductData findFareProduct(List<FareProductData> fareProducts, String fareProductCode)
      Finds a fare product from a list with a matching fare product code
      Parameters:
      fareProducts - the fare products
      fareProductCode - the fare product code
      Returns:
      fare product matching given code
    • collectFareFilterResults

      protected void collectFareFilterResults(List<FareFilterResultModel> filteringResults, List<ItemModel> fareFilterResults)
      Collects the result of fare filtering which then will be used to apply relevant actions
      Parameters:
      filteringResults - the filtering results
      fareFilterResults - the fare filter results
    • collectBundleFilterResults

      @Deprecated protected void collectBundleFilterResults(List<BundleFilterResultModel> filteringResults, List<ItemModel> filterResults)
      Deprecated.
      since version 4.0 use collectBundleTemplateShowResult(List, List) instead
      Collects the result of bundle filtering which then will be used to apply relevant actions
      Parameters:
      filteringResults - the filtering results
      filterResults - the filter resultsdata
    • collectBundleTemplateShowResult

      protected void collectBundleTemplateShowResult(List<BundleTemplateShowResultModel> bundleTemplateShowResults, List<ItemModel> showResults)
      Collect bundle template show result.
      Parameters:
      bundleTemplateShowResults - the filtering results
      showResults - the filter results
    • filterTransportOfferings

      public void filterTransportOfferings(List<TransportOfferingData> transportOfferings, FareSearchRequestData fareSearchRequest)
      Description copied from interface: TravelRulesService
      Method to filter out transport offerings that matches rules
      Specified by:
      filterTransportOfferings in interface TravelRulesService
      Parameters:
      transportOfferings - the transport offerings
      fareSearchRequest - the fare search request