public interface Promotion extends XMLizable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright
|
static java.text.SimpleDateFormat |
DATEFORMAT
Formatter for all time related objects
|
static int |
PROMOTION_EXCLUSIVE_AT_GLOBAL_LEVEL
Value of the exclusiveness setting of a promotion to indicate that it can not be combined with any other promotions.
|
static int |
PROMOTION_EXCLUSIVE_AT_GROUP_LEVEL
Value of the exclusiveness setting of a promotion to indicate that it can not be combined with any other promotions in the same promotion group.
|
static int |
PROMOTION_EXCLUSIVE_NONE
Value of the exclusiveness setting of a promotion to indicate that it may be combined with any other promotions.
|
static int |
PROMOTION_EXCLUSIVE_RBD_ORDERDISCOUNT_COMPATIBLE
Promotion exclusiveness settings, this is created for backward compatibility reason.
|
static int |
PROMOTION_EXCLUSIVE_STACKABLE_AT_GROUP_LEVEL
Value of the exclusiveness setting of a promotion to indicate that it may be combined with any other promotions and it can also apply on items that have already been targeted by other promotions of the same promotion group.
|
static int |
PROMOTION_STATE_ACTIVATING
Value of the state of a promotion used to indicate that it is activating.
|
static int |
PROMOTION_STATE_ACTIVE
Value of the state of a promotion used to indicate that it is active.
|
static int |
PROMOTION_STATE_ARCHIVED
Value of the state of a promotion used to indicate that it is archived.
|
static int |
PROMOTION_STATE_DELETED
Value of the state of a promotion used to indicate that it has been marked for deletion.
|
static int |
PROMOTION_STATE_INACTIVE
Value of the state of a promotion used to indicate that it is inactive.
|
static int |
PROMOTION_STATE_OBSOLETE
Value of the state of a promotion used to indicate that it is obsolete.
|
static int |
PROMOTION_STATE_SUSPENDED
Value of the state of a promotion used to indicate that it has been suspended.
|
static int |
PROMOTION_TYPE_PRIVATE
Value of the promotion type setting of a promotion to indicate that it is
applicable only to those to whom it has been explicitly granted, that is,
this promotion is a coupon promotion.
|
static int |
PROMOTION_TYPE_TARGETED
Value of the promotion type setting of a promotion to indicate that it is
applicable to customers who belong to one or more of the targeted customer
profiles.
|
Modifier and Type | Method and Description |
---|---|
void |
addCustomCondition(Condition restriction)
Appends a custom condition to the list of custom conditions.
|
void |
addExemptedPolicy(PromotionPolicyKey key)
Appends a policy to the list of policies from which this promotion is
explicitly exempted.
|
void |
addExplicitlyAppliedPolicy(PromotionPolicyKey key)
Adds a promotion policy to the list of policies that are explicitly
marked as applicable to a promotion.
|
boolean |
checkTargetingConditionAtRuntime()
Returns the flag value which controls if targeting conditions should be checked at runtime or not
|
boolean |
evaluate(PromotionContext context)
Evaluates if this promotion is applicable to the current order which is part of the context object
being passed to this method.
|
CampaignKey |
getCampaignKey()
Returns the campaign key associated with the promotion.
|
java.lang.String |
getCode()
Returns the visualCue.
|
java.lang.String |
getCorrespondingRBDTypeName()
Deprecated.
Introduced for backward compatibility reasons. This method will be removed in the next release
|
com.ibm.commerce.marketing.promotion.CouponAttribute |
getCouponAttribute()
Returns the coupon attributes associated with the promotion.
|
java.lang.String |
getCurrency()
Returns the currency in which all monetary values in
this promotion are defined.
|
java.util.Iterator |
getCustomConditions()
Returns all custom conditions in an iterator.
|
java.lang.String |
getDescription(java.util.Locale locale,
int type)
Returns the specified type of the description of the promotion in a particular locale.
|
int |
getExclusiveLevel()
Returns the exclusive level of a promotion.
|
java.util.Iterator |
getExemptedPolicies()
Returns a list of explicitly exempted promotion policies.
|
java.util.Iterator |
getExplicitlyAppliedPolicies()
Returns an iterator of all the promotion policies that are explicitly
marked as applicable to this promotion.
|
com.ibm.commerce.marketing.promotion.group.PromotionGroupKey |
getGroupKey()
Returns the promotion group key of the promotion.
|
PromotionKey |
getKey()
Returns the key of this promotion.
|
java.util.Date |
getLastUpdate()
Returns the last updated time of the promotion.
|
CustomerKey |
getLastUpdateBy()
Returns the person who is the last one updates this promotion.
|
java.lang.String |
getName()
Returns the name of the promotion.
|
int |
getPerOrderLimit()
Returns the perOrderLimit.
|
int |
getPerShopperLimit()
Returns the perShopperLimit.
|
java.lang.Integer |
getPriority()
Returns the priority of the promotion.
|
Condition |
getPromotionCodeCondition()
Returns the promotion code condition associated with the promotion.
|
Condition |
getPurchaseCondition()
Returns the purchaseCondition.
|
int |
getRevision()
Returns the revision.
|
Schedule |
getSchedule()
Returns the schedule associated with this promotion.
|
int |
getStatus()
Returns the status of this promotion.
|
Condition |
getTargetingCondition()
Returns the targeting condition associated with the promotion.
|
java.math.BigDecimal |
getTargetSales()
Returns the target sales figure
|
int |
getTotalApplicationCountLimit()
Returns the totalApplicationCountLimit.
|
int |
getType()
Returns the type of the promotion.
|
int |
getVersion()
Returns the version of this promotion.
|
boolean |
ignoreTargettingConditionUponProperPromotionCodeEntry()
Returns whether the targeting condition should be checked at proper promotion code entry.
|
boolean |
isPromotionCodeRequired()
Return whether promotion code is required for this promotion or not.
|
void |
removeExemptedPolicy(PromotionPolicyKey key)
Removes a promotion policy from the exempted list.
|
void |
removeExplicitlyAppliedPolicy(PromotionPolicyKey key)
Removes a promotion policy from the list of policies explicitly marked as
applicable to this promotion.
|
void |
setCampaignKey(CampaignKey campaignkey)
Sets the campaign key associated with the promotion.
|
void |
setCheckTargetingConditionAtRuntime(boolean value)
Sets the flag if targeting condition will be checked at runtime.
|
void |
setCode(java.lang.String code)
Sets the visualCue.
|
void |
setCorrespondingRBDTypeName(java.lang.String newName)
Deprecated.
Introduced for backward compatibility reasons. this method will be removed in the next release
|
void |
setCouponAttribute(com.ibm.commerce.marketing.promotion.CouponAttribute attrs)
Sets the coupon attributes associated with the promotion.
|
void |
setCurrency(java.lang.String currency)
Sets the currency in which all monetary values in this
promotion will be defined.
|
void |
setCustomConditions(java.util.Vector otherRestrictions)
Sets the other restrictions that may be added.
|
void |
setDescription(java.util.Locale locale,
int type,
java.lang.String description)
Sets the specified type of the description of the promotion in a particular locale.
|
void |
setExclusiveLevel(int exclusive)
Sets the exclusive level of the promotion.
|
void |
setGroupKey(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey key)
Sets the promotion group key of the promotion.
|
void |
setIgnoreTargetingConditionUponProperPromotionCodeEntry(boolean ignore)
Sets if the targeting condition to be checked at runtime based on promotion code entry.
|
void |
setKey(PromotionKey key)
Sets the key of the promotion.
|
void |
setLastUpdate(java.util.Date lastUpdate)
Sets the last update date for the promotion.
|
void |
setLastUpdateBy(CustomerKey lastUpdateBy)
Sets the customer key for the promotion that is last updated.
|
void |
setPerOrderLimit(int perOrderLimit)
Sets the per order redemption limit.
|
void |
setPerShopperLimit(int perShopperLimit)
Sets the the maximum number of times a promotion can be
applied to any shopper.
|
void |
setPriority(java.lang.Integer priority)
Sets the priority of the promotion.
|
void |
setPromotionCodeCondition(Condition promotionCodeCondition)
Sets the promotion code condition of the promotion.
|
void |
setPromotionCodeRequired(boolean aPromotionCodeRequired)
Sets the promotion code required flag.
|
void |
setPurchaseCondition(Condition condition)
Sets the purchaseCondition.
|
void |
setSchedule(Schedule schedule)
Sets the schedule of the promotion.
|
void |
setStatus(int status)
Sets the status of the promotion.
|
void |
setTargetingCondition(Condition targetingCondition)
Sets the targeting condition of the promotion.
|
void |
setTargetSales(java.math.BigDecimal sales)
Sets the target sales figure, null is allowed
|
void |
setTotalApplicationCountLimit(int totalApplicationCountLimit)
Sets the limit of how many times a promotion can be redeemed
overall.
|
void |
setType(int type)
Sets the type of promotion.
|
static final java.text.SimpleDateFormat DATEFORMAT
static final java.lang.String COPYRIGHT
static final int PROMOTION_STATE_INACTIVE
static final int PROMOTION_STATE_ACTIVE
static final int PROMOTION_STATE_DELETED
static final int PROMOTION_STATE_SUSPENDED
static final int PROMOTION_STATE_OBSOLETE
static final int PROMOTION_STATE_ACTIVATING
static final int PROMOTION_STATE_ARCHIVED
static final int PROMOTION_EXCLUSIVE_NONE
static final int PROMOTION_EXCLUSIVE_AT_GROUP_LEVEL
static final int PROMOTION_EXCLUSIVE_AT_GLOBAL_LEVEL
static final int PROMOTION_EXCLUSIVE_STACKABLE_AT_GROUP_LEVEL
static final int PROMOTION_EXCLUSIVE_RBD_ORDERDISCOUNT_COMPATIBLE
static final int PROMOTION_TYPE_TARGETED
static final int PROMOTION_TYPE_PRIVATE
java.lang.String getCurrency()
void setCurrency(java.lang.String currency)
currency
- The currency in string format.PromotionKey getKey()
java.lang.String getDescription(java.util.Locale locale, int type)
locale
- The Locale
of the description to be returned.type
- The type of the description to be returned.int getExclusiveLevel()
java.util.Date getLastUpdate()
CustomerKey getLastUpdateBy()
java.lang.String getName()
java.lang.Integer getPriority()
Schedule getSchedule()
int getStatus()
void setDescription(java.util.Locale locale, int type, java.lang.String description)
locale
- The Locale
of the description to be set.type
- The type of the description to be set.description
- The description to set.void setExclusiveLevel(int exclusive)
exclusive
- The exclusive level to set for the promotion.void setKey(PromotionKey key)
key
- The key to set for the promotion.void setLastUpdate(java.util.Date lastUpdate)
lastUpdate
- The lastUpdate date for the promotion to set.void setLastUpdateBy(CustomerKey lastUpdateBy)
lastUpdateBy
- the customer key to set for the promotion that is last updated.void setPriority(java.lang.Integer priority)
priority
- The priority of the promotion to set.void setSchedule(Schedule schedule)
schedule
- The schedule of the promotion to set.void setStatus(int status)
status
- The status of the promotion to set.boolean isPromotionCodeRequired()
Condition getPromotionCodeCondition()
Condition getTargetingCondition()
void setPromotionCodeCondition(Condition promotionCodeCondition)
promotionCodeCondition
- The promotion code condition of the promotion to set.void setTargetingCondition(Condition targetingCondition)
targetingCondition
- the targeting condition of the promotion to set.boolean ignoreTargettingConditionUponProperPromotionCodeEntry()
boolean checkTargetingConditionAtRuntime()
void setCheckTargetingConditionAtRuntime(boolean value)
value
- true if you want targeting condition of this promotion to be checked at runtime, false otherwise.void setIgnoreTargetingConditionUponProperPromotionCodeEntry(boolean ignore)
ignore
- set to true if the targeting condition should be skipped on proper promotion code entry.void addCustomCondition(Condition restriction)
restriction
- a custom condition to add.java.util.Iterator getCustomConditions()
com.ibm.commerce.marketing.promotion.group.PromotionGroupKey getGroupKey()
void setGroupKey(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey key)
key
- The promotion group key of the promotion to set.int getPerOrderLimit()
int getPerShopperLimit()
int getTotalApplicationCountLimit()
void setCustomConditions(java.util.Vector otherRestrictions)
otherRestrictions
- The other restrictions that may be added.void setPerOrderLimit(int perOrderLimit)
perOrderLimit
- The per order redemption limit to set.void setPerShopperLimit(int perShopperLimit)
perShopperLimit
- The maximum number of times a promotion can be
applied to any shopper to set.void setTotalApplicationCountLimit(int totalApplicationCountLimit)
totalApplicationCountLimit
- to set the limit of how many times a promotion can be redeemed
overall.CampaignKey getCampaignKey()
void setCampaignKey(CampaignKey campaignkey)
campaignkey
- to set campaign key associated with the promotion.int getRevision()
int getType()
int getVersion()
void setType(int type)
type
- The type of promotion to set, either targeted or private.java.lang.String getCode()
void setCode(java.lang.String code)
code
- The visualCue to set. VisualCue is the text entered either to
be used as promotion code or to assist the generation of the promotion code.Condition getPurchaseCondition()
void setPurchaseCondition(Condition condition)
condition
- The condition to set. Purchase condition is the
condition that governs certain purchases the customer has
to make in order to qualify for a promotion.void addExemptedPolicy(PromotionPolicyKey key)
key
- the key of the exempted policy to be added.void removeExemptedPolicy(PromotionPolicyKey key)
key
- the
key of the promotion policy to be removed.java.util.Iterator getExemptedPolicies()
void addExplicitlyAppliedPolicy(PromotionPolicyKey key)
key
- the key of the applicable policy that to be added.void removeExplicitlyAppliedPolicy(PromotionPolicyKey key)
key
- the key of the promotion policy to be removed from the list.java.util.Iterator getExplicitlyAppliedPolicies()
com.ibm.commerce.marketing.promotion.CouponAttribute getCouponAttribute()
void setCouponAttribute(com.ibm.commerce.marketing.promotion.CouponAttribute attrs)
attrs
- The coupon attributes associated with the promotion.java.math.BigDecimal getTargetSales()
void setTargetSales(java.math.BigDecimal sales)
sales
- the target sales figurejava.lang.String getCorrespondingRBDTypeName()
void setCorrespondingRBDTypeName(java.lang.String newName)
newName
- The Rules-Based Discount type.boolean evaluate(PromotionContext context) throws PromotionRuntimeException
context
- PromotionContext, note that this parameter is both in and out parameter.If the current
promotion is applicable, this method will further modify the PromotionContext parameter as an output.PromotionRuntimeException
- if any exception is thrown in the process of evaluating this promotion
it will be wrapped in a PromotionRuntimeException and thrown to the caller.void setPromotionCodeRequired(boolean aPromotionCodeRequired)
aPromotionCodeRequired
- true if a correct promotion code is required to redeem this promotion, false
otherwise.