public class PriceRuleEngine extends java.lang.Object implements PriceRuleConstants
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASSNAME
The name of this class.
|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
ANDCHAR, AT, ATTRIBUTE_NAME_ROUNDING_RULE, COMMA, COMMAND_CONTEXT_KEY, DEFAULT_EXTERNAL_PRICE_RULE_IDENTIFIER, ELEMENT_ATTR_COORDINATORTYPE, ELEMENT_ATTR_PRICELISTID, ELEMENT_ATTR_PRICERULE_IN_COORDINATORTYPE, ELEMENT_COORDINATORTYPE_HIGHEST, ELEMENT_COORDINATORTYPE_LOWEST, ELEMENT_COORDINATORTYPE_SEQUENCE, ELEMENT_TEMPLATE_ID_CALCULATE_PRICE, ELEMENT_TEMPLATE_ID_CATALOG_CONDITION, ELEMENT_TEMPLATE_ID_COMPARE_CONDITION, ELEMENT_TEMPLATE_ID_COORDINATOR_BRANCH, ELEMENT_TEMPLATE_ID_CUSTOMER_CONDITION, ELEMENT_TEMPLATE_ID_DYNAMIC_KIT_BRANCH, ELEMENT_TEMPLATE_ID_EXTERNAL_RULE, ELEMENT_TEMPLATE_ID_NESTED_PRICE_RULE, ELEMENT_TEMPLATE_ID_PATH, ELEMENT_TEMPLATE_ID_PRICE_LIST, ELEMENT_TEMPLATE_ID_PRICE_LIST_CONDITION, ELEMENT_TEMPLATE_ID_ROUNDING_PRICE, ELEMENT_TEMPLATE_ID_SIMPLE_BRANCH, EQUALCHAR, EXTENDED_TC_PRICE_RULE_NAME_PROPERTY, EXTERNAL_TYPE, HIGHEST_VALUE, INTERNAL_TYPE, LOWEST_VALUE, NON_EXISTING_OFFER_PRICE, NUMERIC_PRICE_CONSTANT_CURRENCY_NOT_APPLICABLE, OFFERS_FOR_CATALOG_ENTRY_PRICE_LIST_CACHE, OUTER_RULE_ID, PARAMETER_CATENTRY_ID, PARAMETER_CURRENCY, PARAMETER_PRICERULE_EXTRA_DATA_MAP, PARAMETER_PRICERULE_EXTRA_DATA_REQUEST_PROPERTIES_MAP, PARAMETER_PRICERULE_OUTPUT_OBJECT, PARAMETER_QUANTITY, PARAMETER_STORE_ID, PARAMETER_UOM, PRELEMENT_ACTION, PRELEMENT_BRANCH, PRELEMENT_CONDITION, PRELEMENT_COORDINATOR, PRELEMENT_PATH, PRELEMENT_PRICERULE, PRELEMENT_ROUNDING, PRICE_EQUATION_CURRENCY_TYPE, PRICE_EQUATION_ENTRY_TYPE_INPUTPRICE, PRICE_EQUATION_ENTRY_TYPE_LEFT_PARENTHESIS, PRICE_EQUATION_ENTRY_TYPE_NUMBER, PRICE_EQUATION_ENTRY_TYPE_OPERATOR, PRICE_EQUATION_ENTRY_TYPE_PRICECONSTANT, PRICE_EQUATION_ENTRY_TYPE_PRICELIST, PRICE_EQUATION_ENTRY_TYPE_RIGHT_PARENTHESIS, PRICE_EQUATION_NUMBER_TYPE, PRICE_RULE_DEFAULT_OFFER_QUANTITY, PRICE_RULE_DEFAULT_QUANTITY_UOM, PRICE_RULE_DEPENDENT, PRICE_RULE_INDEPENDENT, PRICE_RULE_TC, PRICE_RULE_TC_PROPERTY_BEGIN_DATE, PRICE_RULE_TC_PROPERTY_EXPIRY_DATE, PRICE_RULE_TC_PROPERTY_RULE_ID, RETURNED_OBJECT_CONDITION, RETURNED_OBJECT_OFFERS, ROUNDING_ELEMENT_TEMPLATE_ID, ROUNDING_EXECUTED, SKIP_OFFER_SET, SKIP_OFFER_SET_NO, SKIP_OFFER_SET_YES, TOTAL_PRICE_OF_DYANMIC_KIT, TREAT_DK_AS_ITEM, UNDERLINE
Constructor and Description |
---|
PriceRuleEngine() |
Modifier and Type | Method and Description |
---|---|
com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject |
evaluatePriceRule(com.ibm.commerce.price.rule.runtime.objects.PriceRuleObject priceRule,
java.lang.String catentryId,
java.lang.Double quantity,
java.lang.String uom,
java.lang.String currency,
java.util.Map extDataMap,
com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject prOutputObject)
This method returns an
PriceRuleOutputObject object based on
the priceRule . |
com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject |
evaluatePriceRule(java.lang.String priceRuleId,
java.lang.String catentryId,
java.lang.Double quantity,
java.lang.String uom,
java.lang.String currency,
java.util.Map extDataMap,
com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject prOutputObject)
This method returns an
PriceRuleOutputObject object based on
the priceRule . |
com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject |
evaluatePriceRuleForContract(java.lang.String contractId,
java.lang.String catentryId,
java.lang.Double quantity,
java.lang.String uom,
java.lang.String currency,
java.util.Map extDataMap,
com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject prOutputObject)
This method returns an
PriceRuleOutputObject object based on
the contract. |
void |
initializeConfiguration()
This method initializes the shared
PriceRuleEngine object. |
static PriceRuleEngine |
singleton()
This method returns the shared instance of the
PriceRuleEngine object. |
void |
validatePriceRule(com.ibm.commerce.price.rule.runtime.objects.PriceRuleObject priceRule,
java.lang.String catentryId,
java.lang.Double quantity,
java.lang.String uom,
java.lang.String currency,
java.util.Map extDataMap)
This method validates a given price rule.
|
public static final java.lang.String COPYRIGHT
public static final java.lang.String CLASSNAME
public void initializeConfiguration() throws java.lang.Exception
PriceRuleEngine
object.java.lang.Exception
public static PriceRuleEngine singleton()
PriceRuleEngine
object.public com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject evaluatePriceRuleForContract(java.lang.String contractId, java.lang.String catentryId, java.lang.Double quantity, java.lang.String uom, java.lang.String currency, java.util.Map extDataMap, com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject prOutputObject)
PriceRuleOutputObject
object based on
the contract. It will first retrieve proper price rule for a contract.
Then it will invoke evaluate the price rule.contractId
- The contract id to be set. It can't be null or empty.catentryId
- The catalog entry Id to be set. It can't be null or empty.quantity
- The quantity to be set. It can't be null.uom
- The UOM to be set. It can't be null or empty.currency
- The currency to be set. It can't be null or empty.extDataMap
- The extDataMap to be set. It can be null.prOutputObject
- The prOutputObject to be set. It can be null.public com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject evaluatePriceRule(java.lang.String priceRuleId, java.lang.String catentryId, java.lang.Double quantity, java.lang.String uom, java.lang.String currency, java.util.Map extDataMap, com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject prOutputObject)
PriceRuleOutputObject
object based on
the priceRule
. It will first populate the return object.
Then it will invoke the preProcess, processPriceRule, postProcess method
in a row.priceRuleId
- The price rule id to be set. It can't be null or empty.catentryId
- The catalog entry Id to be set. It can't be null or empty.quantity
- The quantity to be set. It can't be null.uom
- The UOM to be set. It can't be null or empty.currency
- The currency to be set. It can't be null or empty.extDataMap
- The extDataMap to be set. It can be null.prOutputObject
- The prOutputObject to be set. It can be null.public com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject evaluatePriceRule(com.ibm.commerce.price.rule.runtime.objects.PriceRuleObject priceRule, java.lang.String catentryId, java.lang.Double quantity, java.lang.String uom, java.lang.String currency, java.util.Map extDataMap, com.ibm.commerce.price.rule.runtime.objects.PriceRuleOutputObject prOutputObject)
PriceRuleOutputObject
object based on
the priceRule
. It will first validate the price rule, then
populate the return object. After that, it will invoke the preProcess,
processPriceRule, postProcess method in a row.priceRule
- The price rule object to be set. It can't be null.catentryId
- The catalog entry Id to be set. It can't be null or empty.quantity
- The quantity to be set. It can't be null.uom
- The UOM to be set. It can't be null or empty.currency
- The currency to be set. It can't be null or empty.extDataMap
- The extDataMap to be set. It can be null.prOutputObject
- The prOutputObject to be set. It can be null.public void validatePriceRule(com.ibm.commerce.price.rule.runtime.objects.PriceRuleObject priceRule, java.lang.String catentryId, java.lang.Double quantity, java.lang.String uom, java.lang.String currency, java.util.Map extDataMap)
priceRule
- The price rule object to be set. It can't be null.catentryId
- The catalog entry Id to be set. It can't be null or empty.quantity
- The quantity to be set. It can't be null.uom
- The UOM to be set. It can't be null or empty.currency
- The currency to be set. It can't be null or empty.extDataMap
- The extDataMap to be set. It can be null.