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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcollectAccommodationCategories(List<ShowAccommodationCategoryActionResultModel> showAccommodationCategoryActionResultModels, List<ItemModel> showResults) Collect accommodation categories.protected voidcollectAccommodationOfferingsResult(List<ShowAccommodationOfferingActionResultModel> showAccommodationOfferingActionResults, List<ItemModel> showResults) Collect show accommodation offerings result.protected voidcollectAccommodations(List<ShowAccommodationActionResultModel> showAccommodationActionResultModel, List<ItemModel> showResults) Collect accommodations.protected voidcollectBundleFilterResults(List<BundleFilterResultModel> filteringResults, List<ItemModel> filterResults) Deprecated.protected voidcollectBundleTemplateShowResult(List<BundleTemplateShowResultModel> bundleTemplateShowResults, List<ItemModel> showResults) Collect bundle template show result.protected voidcollectFareFilterResults(List<FareFilterResultModel> filteringResults, List<ItemModel> fareFilterResults) Collects the result of fare filtering which then will be used to apply relevant actionsprotected voidcollectProductCategoriesResult(List<ShowProductCategoryActionResultModel> showProductCategoriesActionResults, List<ItemModel> showResults) This method collects product categories show resultprotected voidcollectRatePlansResult(List<ShowRatePlanActionResultModel> showRatePlanActionResults, List<ItemModel> showResults) Collect show rate plans result.protected voidcollectShowExtraProductsResult(List<ShowExtraProductActionResultModel> showProductActionResults, List<ItemModel> showResults) Collect show extra products result.protected voidcollectShowProductsResult(List<ShowProductActionResultModel> showProductActionResults, List<ItemModel> showResults) Collect show products result.protected CartModelMethod to create a dummy cart.evaluateCart(CartModel cart) Method to evaluate cart with rules to add fees and discounts.protected <T> voidfilterActions(RuleEngineResultRAO resultRAO, Class<T> type) Method to filter actions.filterBundles(FareSearchRequestData fareSearchRequestData, UserModel currentUser) Deprecated.since version 4.0filterFareProducts(List<FareProductData> fareProducts, FareSearchRequestData fareSearchRequest) Method to filter out the fare products that match rulesvoidfilterTransportOfferings(List<TransportOfferingData> transportOfferings, FareSearchRequestData fareSearchRequest) Method to filter out transport offerings that matches rulesprotected FareProductDatafindFareProduct(List<FareProductData> fareProducts, String fareProductCode) Finds a fare product from a list with a matching fare product codegetRefundAction(OrderModel orderModel) Method to get refund action after rules evaluationdoubleMethod to get total fee eg:admin fee after evaluating the rules.showAccommodationCategories(AccommodationAvailabilityRequestData availabilityRequestData) Show accommodation categories list.showAccommodationOfferings(AccommodationSearchResponseData accommodationSearchResponseData) Show accommodation offerings.showAccommodations(AccommodationAvailabilityRequestData availabilityRequestData, RoomStayData roomStayData) Show accommodations list.showBundleTemplates(FareSearchRequestData fareSearchRequestData) Method to show bundle templates returned from rule evaluationshowExtraProducts(AccommodationReservationData reservationData) Show extra products list.showProductCategories(OfferRequestData offerRequestData) Method to show product categories returned after evaluating rulesshowProducts(OfferRequestData offerRequestData) Method to show products returned after evaluating rulesshowRatePlans(AccommodationAvailabilityRequestData availabilityRequestData, RoomStayData roomStayData) Show Rate Plans.Methods inherited from class de.hybris.platform.travelrulesengine.services.impl.AbstractTravelEngineService
evaluate, getCommerceRuleEngineService, getDefaultRuleEngineContextName, getFactContextFactory, getRuleActionService, getRuleEngineContextDao, prepareContext, provideRAOs, setCommerceRuleEngineService, setDefaultRuleEngineContextName, setFactContextFactory, setRuleActionService, setRuleEngineContextDao
-
Constructor Details
-
DefaultTravelDroolsService
public DefaultTravelDroolsService()
-
-
Method Details
-
evaluateCart
Description copied from interface:TravelRulesServiceMethod to evaluate cart with rules to add fees and discounts.- Specified by:
evaluateCartin interfaceTravelRulesService- Parameters:
cart- the cart- Returns:
- cart entry
-
getTotalFee
public double getTotalFee()Description copied from interface:TravelRulesServiceMethod to get total fee eg:admin fee after evaluating the rules.- Specified by:
getTotalFeein interfaceTravelRulesService- Returns:
- total fee
-
getRefundAction
Description copied from interface:TravelRulesServiceMethod to get refund action after rules evaluation- Specified by:
getRefundActionin interfaceTravelRulesService- Parameters:
orderModel- the order model- Returns:
- refund action type
-
filterActions
Method to filter actions.- Type Parameters:
T- the type parameter- Parameters:
resultRAO- the result raotype- the type
-
filterFareProducts
public List<FareProductData> filterFareProducts(List<FareProductData> fareProducts, FareSearchRequestData fareSearchRequest) Description copied from interface:TravelRulesServiceMethod to filter out the fare products that match rules- Specified by:
filterFareProductsin interfaceTravelRulesService- Parameters:
fareProducts- the fare productsfareSearchRequest- 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.0Returns the list of bundle templates that needs to be filtered from the search result- Specified by:
filterBundlesin interfaceTravelRulesService- Parameters:
fareSearchRequestData- the fare search request datacurrentUser- the current user- Returns:
-
showBundleTemplates
Description copied from interface:TravelRulesServiceMethod to show bundle templates returned from rule evaluation- Specified by:
showBundleTemplatesin interfaceTravelRulesService- Parameters:
fareSearchRequestData- the fare search request data- Returns:
- list of bundle templates returned from rules evaluation
-
showProducts
Description copied from interface:TravelRulesServiceMethod to show products returned after evaluating rules- Specified by:
showProductsin interfaceTravelRulesService- 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 resultsshowResults- the show results
-
showProductCategories
Description copied from interface:TravelRulesServiceMethod to show product categories returned after evaluating rules- Specified by:
showProductCategoriesin interfaceTravelRulesService- 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 resultsshowResults- the show results
-
showExtraProducts
Description copied from interface:TravelRulesServiceShow extra products list.- Specified by:
showExtraProductsin interfaceTravelRulesService- 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 resultsshowResults- the show results
-
showAccommodationOfferings
public List<String> showAccommodationOfferings(AccommodationSearchResponseData accommodationSearchResponseData) Description copied from interface:TravelRulesServiceShow accommodation offerings.- Specified by:
showAccommodationOfferingsin interfaceTravelRulesService- Parameters:
accommodationSearchResponseData- the accommodation search response data- Returns:
- the list
-
showAccommodationCategories
public List<String> showAccommodationCategories(AccommodationAvailabilityRequestData availabilityRequestData) Description copied from interface:TravelRulesServiceShow accommodation categories list.- Specified by:
showAccommodationCategoriesin interfaceTravelRulesService- 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 modelsshowResults- 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 resultsshowResults- the show results
-
showRatePlans
public List<String> showRatePlans(AccommodationAvailabilityRequestData availabilityRequestData, RoomStayData roomStayData) Description copied from interface:TravelRulesServiceShow Rate Plans.- Specified by:
showRatePlansin interfaceTravelRulesService- Parameters:
availabilityRequestData- the accommodation availability request dataroomStayData- 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 resultsshowResults- the list of results
-
showAccommodations
public List<String> showAccommodations(AccommodationAvailabilityRequestData availabilityRequestData, RoomStayData roomStayData) Description copied from interface:TravelRulesServiceShow accommodations list.- Specified by:
showAccommodationsin interfaceTravelRulesService- Parameters:
availabilityRequestData- the accommodation availability request dataroomStayData- 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 modelshowResults- the show results
-
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 productsfareProductCode- 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 resultsfareFilterResults- the fare filter results
-
collectBundleFilterResults
@Deprecated protected void collectBundleFilterResults(List<BundleFilterResultModel> filteringResults, List<ItemModel> filterResults) Deprecated.since version 4.0 usecollectBundleTemplateShowResult(List, List)insteadCollects the result of bundle filtering which then will be used to apply relevant actions- Parameters:
filteringResults- the filtering resultsfilterResults- the filter resultsdata
-
collectBundleTemplateShowResult
protected void collectBundleTemplateShowResult(List<BundleTemplateShowResultModel> bundleTemplateShowResults, List<ItemModel> showResults) Collect bundle template show result.- Parameters:
bundleTemplateShowResults- the filtering resultsshowResults- the filter results
-
filterTransportOfferings
public void filterTransportOfferings(List<TransportOfferingData> transportOfferings, FareSearchRequestData fareSearchRequest) Description copied from interface:TravelRulesServiceMethod to filter out transport offerings that matches rules- Specified by:
filterTransportOfferingsin interfaceTravelRulesService- Parameters:
transportOfferings- the transport offeringsfareSearchRequest- the fare search request
-
collectBundleTemplateShowResult(List, List)instead