public class PriceRuleHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
PriceRuleHelper() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.Boolean,java.math.BigDecimal> | applyRounding(java.lang.String roundingPatterns, java.lang.String definingCurrencies, java.math.BigDecimal value, java.lang.String currency)
This method applies rounding on the input value.
|
boolean | belongsToMemberGroup(java.lang.String memberId, java.lang.String memberGroupId, java.lang.Integer storeId)
Check if a person belongs to a member group.
|
boolean | belongsToOrganization(java.lang.String userID, java.lang.String orgIdentifier)
Check if a user belongs to an organization.
|
java.util.HashMap | constructRoudingPatternsHashMap(java.lang.String pattern)
This method constructs a hash map to contain the rounding values.
|
java.math.BigDecimal | digitsToValue(java.lang.Integer[] inputDigits)
The method converts the array of digits into a value.
|
java.math.BigDecimal | digitsToValue(java.lang.String[] inputDigits)
The method converts the array of digits into a value.
|
boolean | doesContractHavePriceRuleTC(java.lang.Long contractID, java.lang.Long memberID)
Check whether the specified contract contains Price Rule TC, no matter it is in effective date or not
|
boolean | doesPriceRuleHaveSpecifiedElement(java.lang.String priceRuleId, java.lang.String elementTplId)
Checks whether the price rule has specified element.
|
java.util.Set<java.lang.Integer> | findPriceRuleExtendedStores(java.lang.Integer storeId)
This method find all stores which will extend the price rules of a specific store in store relations.
|
java.lang.String | getAllCategoriesForCatentry(java.lang.String catentryId)
This method returns all parent categories for a catalog entry.
|
java.lang.String | getAllCatentriesForCatentry(java.lang.String catentryId)
This method returns all parent catalog entries for a catalog entry.
|
java.util.Map<java.lang.String,java.util.List<com.ibm.commerce.price.rule.runtime.objects.PriceRuleElementObject>> | getAllPathsInRule(java.lang.String priceRuleId, boolean inspectNestedRule)
This method calculate all possible paths in the price rule object by tracing all its branches and their combination.
|
java.util.List<java.util.List<java.lang.String>> | getAllPriceListsFromPriceRule(java.lang.String priceRuleId)
Gets all the price list identifiers from a price rule.
|
java.math.BigDecimal | getBestPriceConstantValueWithCurrencyConversion(java.util.List prconvalueList, java.lang.String storeId, java.lang.String toCurrency)
This method retrieves the best currency value of a price constant with conversion to the desired currency.
|
MonetaryAmount | getBestPriceForOfferWithSpecificCurrency(java.lang.String offerId, java.lang.String currency, java.lang.String storeId)
Get best price for an offer with specific currency, if the currency is null, will return alternative prices.
|
java.lang.String | getCategoriesForCategory(java.lang.String catalogId, java.lang.String categoryId)
This method returns all parent categories for a category.
|
java.util.List<ContractType> | getContractsByReferrencedPriceRule(java.lang.String priceRuleId)
Gets the contract logical noun which refer the price rule.
|
java.lang.String | getCurrency(CommandContext aCommandContext)
Get currency with the Helper utility.
|
java.sql.Timestamp | getCurrentTime(CommandContext commandContext)
Returns the current time from the command context.
|
java.lang.String | getExpressionByEquationId(java.lang.String priceEquationId)
This method will retrieve expression from equation.
|
java.lang.Integer[][] | getInputDigits(java.math.BigDecimal value, int decimalLength)
This method parses the input value and retrieves the array of digits from smallest to highest of the input value.
|
static PriceRuleHelper | getInstance()
This method returns an instance of this class.
|
java.math.BigDecimal | getOfferPriceWithSpecifiedCurrency(java.lang.String priceListIdStr, java.lang.String catentryIdStr, java.lang.String storeId, java.lang.String currency, java.lang.String uom, java.lang.Double quantity)
This method is used to get the base offer price for a catalog entry in a specific price list.
|
java.math.BigDecimal | getOfferPriceWithSpecifiedCurrency(java.lang.String priceListIdStr, java.lang.String catentryIdStr, java.lang.String storeId, java.lang.String currency, java.lang.String uom, java.lang.Double quantity, java.util.Map runtimeParameters)
This method is used to get the base offer price for a catalog entry in a specific price list.
|
java.util.List<com.ibm.commerce.price.facade.datatypes.PriceEquationType> | getPriceEquationsByReferrencedPriceConstant(java.lang.String priceConstantId)
Gets the price equation logical noun which refer the price constant.
|
java.util.List<com.ibm.commerce.price.facade.datatypes.PriceEquationType> | getPriceEquationsByReferrencedPriceConstantInAllStores(java.lang.String priceConstantId)
Gets the price equation logical noun which refer the price constant from all stores.
|
java.util.List<com.ibm.commerce.price.facade.datatypes.PriceEquationType> | getPriceEquationsByReferrencedPriceList(java.lang.String priceListId)
Gets the price equation logical noun which refer the price list.
|
java.util.Set<java.lang.Integer> | getPriceRuleReferencedStoreIds(java.lang.String priceRuleId)
This method find all stores which could reference a price rule It will return the Id of the stores as a java.util.Set
|
java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> | getPriceRulesByReferrencedPriceConstant(java.lang.String priceConstantId)
Gets the price rule logical noun which refer the price constant.
|
java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> | getPriceRulesByReferrencedPriceConstantInAllStores(java.lang.String priceConstantId)
Gets the price rule logical noun which refer the price constant from all stores.
|
java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> | getPriceRulesByReferrencedPriceEquation(java.lang.String priceEquationId)
Gets the price rule logical noun which refer the price equation.
|
java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> | getPriceRulesByReferrencedPriceEquationInAllStores(java.lang.String priceEquationId)
Gets the price rule logical noun which refer the price equation from all stores.
|
java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> | getPriceRulesByReferrencedPriceList(java.lang.String priceListId)
Gets the price rule logical noun which refer the price list.
|
java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> | getPriceRulesByReferrencedPriceRule(java.lang.String priceRuleId)
Gets the price rule logical noun which refer the price rule.
|
RuleEngineExecutePriceRuleCmd | getRuleExecutionCommand(com.ibm.commerce.price.facade.datatypes.PriceRuleType priceRule, java.lang.Integer aStoreId)
This method returns a proper implementation of RuleEngineExecutePriceRuleCmd command according to price rule name, price rule type and store.
|
java.util.List<java.lang.String> | getSortedPathsInRule(java.lang.String priceRuleId, boolean inspectNestedRule)
This method calculate all possible paths in the price rule object by tracing all its branches and their combination.
|
ExtendedTermConditionAccessBean | getValidPriceRuleExtendeTC(java.lang.Long contractID, java.lang.Long memberID, java.sql.Timestamp currentTime)
Get valid price rule extended term condition.
|
boolean | isCatentryInCatalogFilter(java.lang.String catFilterId, java.lang.String catEntryId)
Determine if a catalog entry is included by a catalog filter.
|
protected boolean | isOrgMatch(java.lang.String orgIdentifier, OrganizationAccessBean orgAB)
Check if the specified organization identifier is same as the unique ID or name of the specified organization or its ancestors.
|
boolean | isPatternMatchCurrency(java.lang.String pattern, java.lang.String currency)
Judge if the specified pattern matches the input currency.
|
boolean | isValidDate(java.sql.Timestamp beginDate, java.sql.Timestamp expiryDate, java.sql.Timestamp currentTime)
Check whether the date is valid compared with the current time.
|
boolean | isValidOffer(java.lang.Double offerMinQuantity, java.lang.Double offerMaxQuantity, java.lang.String offerUOM, QuantityAmount aQuantity, java.lang.Long catentryID)
Filter the valid offer.
|
boolean | isValidPriceRuleId(java.lang.String priceRuleId)
Check whether the price rule id is not empty
|
java.lang.String | resolvePriceRuleIdFromContract(java.lang.Long aContractId, CommandContext commandContext)
Resolves price rule identifier from a given contract.
|
java.util.Map | retrieveParentCatalogEntryIds(java.lang.Long[] aCatEntryIDsArr)
This method retrieves the parent catalog entry IDs for an array of catalog entries.
|
java.lang.String[] | rounding(java.lang.Integer[][] digitsToBeRounded, java.util.HashMap hshRoudingPatterns)
This method applies the rounding rules on the input digits.
|
public static final java.lang.String COPYRIGHT
public static PriceRuleHelper getInstance()
public java.lang.String getAllCategoriesForCatentry(java.lang.String catentryId)
public java.lang.String getCategoriesForCategory(java.lang.String catalogId, java.lang.String categoryId)
public java.lang.String getAllCatentriesForCatentry(java.lang.String catentryId)
public java.lang.String getCurrency(CommandContext aCommandContext)
public MonetaryAmount getBestPriceForOfferWithSpecificCurrency(java.lang.String offerId, java.lang.String currency, java.lang.String storeId)
public boolean isValidOffer(java.lang.Double offerMinQuantity, java.lang.Double offerMaxQuantity, java.lang.String offerUOM, QuantityAmount aQuantity, java.lang.Long catentryID)
public java.math.BigDecimal getOfferPriceWithSpecifiedCurrency(java.lang.String priceListIdStr, java.lang.String catentryIdStr, java.lang.String storeId, java.lang.String currency, java.lang.String uom, java.lang.Double quantity) throws ECException
public java.math.BigDecimal getOfferPriceWithSpecifiedCurrency(java.lang.String priceListIdStr, java.lang.String catentryIdStr, java.lang.String storeId, java.lang.String currency, java.lang.String uom, java.lang.Double quantity, java.util.Map runtimeParameters) throws ECException
public java.util.Map retrieveParentCatalogEntryIds(java.lang.Long[] aCatEntryIDsArr) throws ECException
public boolean isCatentryInCatalogFilter(java.lang.String catFilterId, java.lang.String catEntryId)
public java.math.BigDecimal getBestPriceConstantValueWithCurrencyConversion(java.util.List prconvalueList, java.lang.String storeId, java.lang.String toCurrency) throws ECException
public java.util.Map<java.lang.Boolean,java.math.BigDecimal> applyRounding(java.lang.String roundingPatterns, java.lang.String definingCurrencies, java.math.BigDecimal value, java.lang.String currency)
public boolean isPatternMatchCurrency(java.lang.String pattern, java.lang.String currency)
public java.lang.String[] rounding(java.lang.Integer[][] digitsToBeRounded, java.util.HashMap hshRoudingPatterns)
public java.math.BigDecimal digitsToValue(java.lang.Integer[] inputDigits)
public java.lang.Integer[][] getInputDigits(java.math.BigDecimal value, int decimalLength)
public java.util.HashMap constructRoudingPatternsHashMap(java.lang.String pattern)
public java.math.BigDecimal digitsToValue(java.lang.String[] inputDigits)
public java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> getPriceRulesByReferrencedPriceConstant(java.lang.String priceConstantId) throws com.ibm.commerce.price.facade.client.PriceRuleException
public java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> getPriceRulesByReferrencedPriceRule(java.lang.String priceRuleId) throws com.ibm.commerce.price.facade.client.PriceRuleException
public java.util.List<ContractType> getContractsByReferrencedPriceRule(java.lang.String priceRuleId) throws ContractException
public java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> getPriceRulesByReferrencedPriceEquation(java.lang.String priceEquationId) throws com.ibm.commerce.price.facade.client.PriceRuleException
public java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> getPriceRulesByReferrencedPriceList(java.lang.String priceListId) throws com.ibm.commerce.price.facade.client.PriceRuleException
public java.util.List<com.ibm.commerce.price.facade.datatypes.PriceEquationType> getPriceEquationsByReferrencedPriceConstant(java.lang.String priceConstantId) throws com.ibm.commerce.price.facade.client.PriceEquationException
public java.util.List<com.ibm.commerce.price.facade.datatypes.PriceEquationType> getPriceEquationsByReferrencedPriceList(java.lang.String priceListId) throws com.ibm.commerce.price.facade.client.PriceEquationException
public java.lang.String getExpressionByEquationId(java.lang.String priceEquationId) throws DataMediatorException
public boolean belongsToMemberGroup(java.lang.String memberId, java.lang.String memberGroupId, java.lang.Integer storeId) throws java.lang.Exception
public boolean belongsToOrganization(java.lang.String userID, java.lang.String orgIdentifier) throws java.lang.Exception
protected boolean isOrgMatch(java.lang.String orgIdentifier, OrganizationAccessBean orgAB) throws java.lang.Exception
public RuleEngineExecutePriceRuleCmd getRuleExecutionCommand(com.ibm.commerce.price.facade.datatypes.PriceRuleType priceRule, java.lang.Integer aStoreId)
public ExtendedTermConditionAccessBean getValidPriceRuleExtendeTC(java.lang.Long contractID, java.lang.Long memberID, java.sql.Timestamp currentTime) throws ECSystemException
public boolean doesContractHavePriceRuleTC(java.lang.Long contractID, java.lang.Long memberID) throws ECSystemException
public boolean isValidDate(java.sql.Timestamp beginDate, java.sql.Timestamp expiryDate, java.sql.Timestamp currentTime)
public boolean isValidPriceRuleId(java.lang.String priceRuleId)
public java.util.Map<java.lang.String,java.util.List<com.ibm.commerce.price.rule.runtime.objects.PriceRuleElementObject>> getAllPathsInRule(java.lang.String priceRuleId, boolean inspectNestedRule)
public java.util.List<java.lang.String> getSortedPathsInRule(java.lang.String priceRuleId, boolean inspectNestedRule)
public java.util.List<java.util.List<java.lang.String>> getAllPriceListsFromPriceRule(java.lang.String priceRuleId)
public java.util.Set<java.lang.Integer> getPriceRuleReferencedStoreIds(java.lang.String priceRuleId)
public java.util.Set<java.lang.Integer> findPriceRuleExtendedStores(java.lang.Integer storeId)
public java.lang.String resolvePriceRuleIdFromContract(java.lang.Long aContractId, CommandContext commandContext) throws ECSystemException
public java.sql.Timestamp getCurrentTime(CommandContext commandContext)
public java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> getPriceRulesByReferrencedPriceConstantInAllStores(java.lang.String priceConstantId) throws com.ibm.commerce.price.facade.client.PriceRuleException
public java.util.List<com.ibm.commerce.price.facade.datatypes.PriceRuleType> getPriceRulesByReferrencedPriceEquationInAllStores(java.lang.String priceEquationId) throws com.ibm.commerce.price.facade.client.PriceRuleException
public java.util.List<com.ibm.commerce.price.facade.datatypes.PriceEquationType> getPriceEquationsByReferrencedPriceConstantInAllStores(java.lang.String priceConstantId) throws com.ibm.commerce.price.facade.client.PriceEquationException
public boolean doesPriceRuleHaveSpecifiedElement(java.lang.String priceRuleId, java.lang.String elementTplId)