public class DefaultPromotion extends java.lang.Object implements Promotion
Promotion
interface. Refer to the details of the methods below.
XML Snippet of the DefaultPromotion is as follows:
<Promotion impl="com.ibm.commerce.marketing.promotion.DefaultPromotion"> <!-- this identifies the promotion. --> <PromotionKey> <!-- Name of the promotion --> <PromotionName>DollarsOffPromotionOne</PromotionName> <!-- The store which owns this promotion. Store key is defined as the combination of the DN of the organization that owns this store and a store name --> <StoreKey> <DN>o=Root Organization</DN> <Identifier>BlueStore 201</Identifier> </StoreKey> <!-- Versions of a promotion. Statistics are associated with the version number,promotions with the same promotion key and version number but different revision are considered different revisions of the same promotion. Promotions with the same key but different version numbers are considered distinct promotions. --> <Version>0</Version> <Revision>0</Revision> </PromotionKey> <!-- Promotions are group by groups, and groups are scoped by store, refer to promotion organization for details on what a group is, its role and the default groups --> <PromotionGroupKey> <GroupName>OrderLevelPromotion</GroupName> <StoreKey> <DN>o=Root Organization</DN> <Identifier>BlueStore 201</Identifier> </StoreKey> </PromotionGroupKey> <!-- Various descriptions of the promotion --> <TypedNLDescription impl="com.ibm.commerce.marketing.promotion.TypedNLDescription"> <DefaultLocale>en_US</DefaultLocale> <Description locale="en_US" type="admin">[en_US:admin]A sample promotion</Description> <Description locale="en_US" type="long">[en_US:long]A sample promotion</Description> <Description locale="en_US" type="short">[en_US:short]A sample promotion</Description> <Description locale="fr_FR" type="admin">[fr_FR:admin]A sample promotion</Description> <Description locale="fr_FR" type="long">[fr_FR:long]A sample promotion</Description> <Description locale="fr_FR" type="short">[fr_FR:short]A sample promotion</Description> </TypedNLDescription> <!-- Priority of the promotion the higher the more important --> <Priority>1000</Priority> <!-- Exclusiveness of the promotion. Possible values are: 0: not exclusive at all 1: exclusive at the group level 2: exclusive at a global level 3: a backward compatibility mode that mimics the combinability of order level promotions with product level promotions in previous releases --> <Exclusive>3</Exclusive> <!-- For future use, always empty for now --> <ExemptPolicyList /> <!-- For future use, always empty for now --> <ExplicitlyAppliedPolicyList /> <!-- Status of the promotion: 0: inactive 1: active 2: deleted 3: suspended 4: obsolete --> <Status>1</Status> <!-- Audit trail, last update time and last person who updated the promotion --> <LastUpdate>01-09-2003 12:00:00</LastUpdate> <LastUpdateBy> <CustomerKey> <LogonId>wcsadmin</LogonId> </CustomerKey> </LastUpdateBy> <!-- How many times this promotion can be applied to the current order, possible values are: -1: unlimited positive number: the limit --> <PerOrderLimit>1</PerOrderLimit> <!-- How many times this promotion can be applied to a shopper, possible values are: -1: unlimited, positive number: the limit This value is only valid for a registered shopper, for none registered shoppers there is no way to control how many times a shopper can redeem a promotion. --> <PerShopperLimit>-1</PerShopperLimit> <!-- How many times this promotion can be redeemed overall. Possible values are: -1: unlimited, positive number: the limit --> <ApplicationLimit>-1</ApplicationLimit> <!-- Schedule information of this promotion --> <Schedule impl="com.ibm.commerce.marketing.promotion.schedule.PromotionSchedule"> <DateRange impl="com.ibm.commerce.marketing.promotion.schedule.DateRangeSchedule"> <Start inclusive="true">01-09-2003</Start> <End inclusive="true">31-12-2004</End> </DateRange> <TimeWithinADay impl="com.ibm.commerce.marketing.promotion.schedule.TimeRangeWithinADaySchedule"> <Start inclusive="true">00:00:00</Start> <End inclusive="false">23:59:59</End> </TimeWithinADay> <Week impl= "com.ibm.commerce.marketing.promotion.schedule.WeekDaySchedule"> <WeekDay>Sunday</WeekDay> <WeekDay>Monday</WeekDay> <WeekDay>Tuesday</WeekDay> <WeekDay>Wednesday</WeekDay> <WeekDay>Thursday</WeekDay> <WeekDay>Friday</WeekDay> <WeekDay>Saturday</WeekDay> </Week> </Schedule> <!-- Type of promotion: 0: targeted 1: private, that is, a coupon promotion --> <PromotionType>0</PromotionType> <!-- Optional, if default promotion code manager and resolver are used, this is the promotion code for this promotion, if not, this can be left empty or used as cue for promotion code generation --> <PromotionCodeCue>PXO002</PromotionCodeCue> <!-- Whether a code is required to redeem this promotion. --> <PromotionCodeRequired>false</PromotionCodeRequired> <!-- Check the target condition or not --> <CheckTargetingConditionAtRuntime>true</CheckTargetingConditionAtRuntime> <!-- When a promotion code is entered, should the target condition be checked --> <SkipTargetingConditionOnProperPromotionCodeEntered>false</SkipTargetingConditionOnProperPromotionCodeEntered> <!-- Do not change this element--> <PromotionCodeCondition impl= "com.ibm.commerce.marketing.promotion.condition.PromotionCodeCondition" /> <!-- Targeting condition based on customer segments defined in WebSphere Commerce --> <Targeting impl= "com.ibm.commerce.marketing.promotion.condition.TargetingCondition"> <TargetedProfile> <CustomerProfileKey> <OwnerDN>o=Root Organization</OwnerDN> <ProfileName>EmptyNester</ProfileName> </CustomerProfileKey> <CustomerProfileKey> <OwnerDN>o=Root Organization</OwnerDN> <ProfileName>DINK Couple</ProfileName> </CustomerProfileKey> </TargetedProfile> <ExcludedProfile> <CustomerProfileKey> <OwnerDN>o=Root Organization</OwnerDN> <ProfileName>Employee</ProfileName> </CustomerProfileKey> </ExcludedProfile> </Targeting> <!-- Custom condition can be added here for example: <CustomConditions> <Condition impl= "com.myCompany.condition.custom.MyOtherMoreComplexCondition"> <!-- Where myCompany is a custom package name. --> <ConfigParameter1>XXXX</ConfigParameter1> <ConfigParameter2> <CP2.1>YYYY</CP2.1> <CP2.2>ZZZZ</CP2.2> </ConfigParameter2> </Condition> </CustomConditions> --> <CustomConditions /> <!-- This is core of a promotion definition. It follows the model introduced in appendix B --> <PurchaseCondition impl= "com.ibm.commerce.marketing.promotion.condition.PurchaseCondition"> <!-- Matches the pattern targeted by the current promotion: the following pattern matches the entire order, for details refer to the promotion purchase condition model document --> <Pattern impl="com.ibm.commerce.marketing.promotion.condition.Pattern"> <!-- A pattern is made up of multiple constraint, each specifying a list of items that make up part of the pattern. There must be no cross-sections between constraints --> <Constraint impl= "com.ibm.commerce.marketing.promotion.condition.Constraint"> <!-- Quantity requirement of this constraint --> <WeightedRange impl= "com.ibm.commerce.marketing.promotion.condition.WeightedRange"> <!-- minimum number of item is 1 --> <LowerBound>1</LowerBound> <!-- Maximum number of item is not limited --> <UpperBound>-1</UpperBound> <!-- Match as many as items that satisfy the criteria defined in the filter chain next --> <Weight>1</Weight> </WeightedRange> <!-- Selection criteria --> <FilterChain impl= "com.ibm.commerce.marketing.promotion.condition.FilterChain"> <!-- Multiple filters can be specified, the are applied in a contiguous fashion, that is, connected using a logical "and". --> <!-- The dummy filter returns anything passed to it, it effectively selects anything --> <Filter impl= "com.ibm.commerce.marketing.promotion.condition.DummyFilter" /> </FilterChain> <!-- The combination of the quantity requirement and the filter chain would return everything present in the shopcart as one big matched pattern --> </Constraint> </Pattern> <!-- Once pattern is matched, rewards are assigned, for details refer to the purchase condition model document --> <Distribution impl= "com.ibm.commerce.marketing.promotion.reward.Distribution"> <!-- A volume based distribution on the spending total is performed, spending total is measure in CAD --> <Type>Volume</Type> <Base>Cost</Base> <Currency>CAD</Currency> <!-- Not all matched patterns are rewarded, for example, a combination of shirts and pants priced over $120 if a combination of shirts and pants which is priced at $100, it should be eliminated, for most cases this filter is not required and therefore a DummyPatternFilter is used --> <PatternFilter impl= "com.ibm.commerce.marketing.promotion.condition.DummyPatternFilter" /> <!-- First range 100 <= spending <= 200 --> <Range impl= "com.ibm.commerce.marketing.promotion.reward.DistributionRange"> <UpperBound>200</UpperBound> <LowerBound>100</LowerBound> <!-- For future purchase, choice not supported in this release --> <RewardChoice> <!-- This reward, if the spending total of ALL matched patterns falls into the range of 100 to 200 --> <Reward impl= "com.ibm.commerce.marketing.promotion.reward.DefaultReward"> <AdjustmentFunction impl="com.ibm.commerce.marketing.promotion.reward.AdjustmentFunction"> <!-- Reward can be associated with a sub set of the items that make up the pattern,the input of this filter chain will be one matched pattern, and a sub set of items that make up that pattern is returned and adjustments are associated with the returned items also known as affected items --> <FilterChain impl= "com.ibm.commerce.marketing.promotion.condition.FilterChain"> <Filter impl= "com.ibm.commerce.marketing.promotion.condition.DummyFilter" /> </FilterChain> <!-- the adjustment --> <Adjustment impl= "com.ibm.commerce.marketing.promotion.reward.FixedAmountOffAdjustment"> <AmountOff>15</AmountOff> <Currency>CAD</Currency> <!-- This adjustment is applied to the entire order, possible values are: (case insentitive) wholeOrder: The entire order, that is, $15 dollars off an entire order AllAffectedItems: Affected items returned by the filter chain defined above, that is, $15 dollars off all of the affected items as a whole. IndividualAffectedItems: Adjustments are applied to affected items individually, that is, $15 dollars off each and every affected item. --> <AdjustmentType>wholeOrder</AdjustmentType> </Adjustment> </AdjustmentFunction> </Reward> </RewardChoice> </Range> <!-- Another range, $200 < spending --> <Range impl="com.ibm.commerce.marketing.promotion.reward.DistributionRange"> <UpperBound>-1</UpperBound> <LowerBound>200</LowerBound> <LowerBoundIncluded>false</LowerBoundIncluded> <RewardChoice> <Reward impl= "com.ibm.commerce.marketing.promotion.reward.DefaultReward"> <AdjustmentFunction impl= "com.ibm.commerce.marketing.promotion.reward.AdjustmentFunction"> <FilterChain impl="com.ibm.commerce.marketing.promotion.condition.FilterChain"> <Filter impl="com.ibm.commerce.marketing.promotion.condition.DummyFilter" /> </FilterChain> <Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FixedAmountOffAdjustment"> <AmountOff>45</AmountOff> <Currency>CAD</Currency> <AdjustmentType>wholeOrder</AdjustmentType> </Adjustment> </AdjustmentFunction> </Reward> </RewardChoice> </Range> </Distribution> </PurchaseCondition> </Promotion>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copy right.
|
DATEFORMAT, PROMOTION_EXCLUSIVE_AT_GLOBAL_LEVEL, PROMOTION_EXCLUSIVE_AT_GROUP_LEVEL, PROMOTION_EXCLUSIVE_NONE, PROMOTION_EXCLUSIVE_RBD_ORDERDISCOUNT_COMPATIBLE, PROMOTION_EXCLUSIVE_STACKABLE_AT_GROUP_LEVEL, PROMOTION_STATE_ACTIVATING, PROMOTION_STATE_ACTIVE, PROMOTION_STATE_ARCHIVED, PROMOTION_STATE_DELETED, PROMOTION_STATE_INACTIVE, PROMOTION_STATE_OBSOLETE, PROMOTION_STATE_SUSPENDED, PROMOTION_TYPE_PRIVATE, PROMOTION_TYPE_TARGETED
Constructor and Description |
---|
DefaultPromotion()
Default Constructor for Promotion.
|
Modifier and Type | Method and Description |
---|---|
void |
addCustomCondition(Condition aRestriction)
Adds a custom condition to this promotion.
|
void |
addExemptedPolicy(PromotionPolicyKey aKey)
Appends a policy to the list of policies from which this promotion is
explicitly exempted.
|
void |
addExplicitlyAppliedPolicy(PromotionPolicyKey aKey)
Adds a promotion policy to the list of policies that are explicitly
marked as applicable to a promotion.
|
boolean |
checkTargetingConditionAtRuntime()
Returns if to check targeting condition at runtime.
|
void |
clearAttributeNamesCache()
This methods clears the rule list names cache
|
void |
clearExemptedPolicyList()
Resets the exempted policies list.
|
void |
clearExplicitlyAppliedPolicyList()
Resets the list of promotion policies that are marked as explicitly
applicable.
|
boolean |
evaluate(PromotionContext context)
Evaluates if this promotion is applicable to an order or not.
|
void |
fromXML(org.w3c.dom.Node node)
Transforms the XML node into its corresponding real Object.
|
java.util.List |
getAttributeNames()
Gets the attribute names defined by rule list specified by promotion
|
CampaignKey |
getCampaignKey()
Returns the campaignKey.
|
java.lang.String |
getCode()
Returns the visualCue.
|
int |
getCodeCouponPerOrderLimit()
Returns the codeCouponPerOrderLimit.
|
java.lang.String |
getCorrespondingRBDTypeName()
Deprecated.
This method is intended for internal usage.
|
com.ibm.commerce.marketing.promotion.CouponAttribute |
getCouponAttribute()
Returns the coupon attributes associated with the promotion.
|
java.lang.String |
getCurrency()
Returns the currency.
|
java.util.Iterator |
getCustomConditions()
Returns the list of custom conditions.
|
Description |
getDescription()
Gets the description of the promotion.
|
java.lang.String |
getDescription(java.util.Locale alocale,
int atype)
Returns the specified type of the description of the promotion in a particular locale.
|
int |
getExclusiveLevel()
Returns the exclusive level.
|
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 group that this promotion belongs to.
|
PromotionKey |
getKey()
Returns the key.
|
java.util.Date |
getLastUpdate()
Returns the lastUpdate date.
|
CustomerKey |
getLastUpdateBy()
Returns the customer key representing who last updates the promotion.
|
java.lang.String |
getName()
Returns the name of promotion.
|
int |
getPerOrderLimit()
Returns the perOrderLimit.
|
int |
getPerShopperLimit()
Returns the perShopperLimit.
|
java.lang.Integer |
getPriority()
Returns the priority.
|
Condition |
getPromotionCodeCondition()
Returns the condition of promotion code.
|
Condition |
getPurchaseCondition()
Returns the purchaseCondition.
|
int |
getRevision()
Returns the revision.
|
Schedule |
getSchedule()
Returns the schedule associated with the promotion.
|
int |
getStatus()
Returns the status of the promotion.
|
Condition |
getTargetingCondition()
Returns the targeting condition.
|
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 true if targeting condition is to be checked at runtime.
|
boolean |
isPromotionCodeRequired()
Returns the promotionCodeRequired.
|
void |
removeExemptedPolicy(PromotionPolicyKey aKey)
Removes a promotion policy from the exempted list.
|
void |
removeExplicitlyAppliedPolicy(PromotionPolicyKey aKey)
Removes a promotion policy from the list of policies explicitly marked as
applicable to this promotion.
|
void |
setAttributeNames(java.util.List<java.lang.String> names)
Sets the attribute rule list names specified by names provided
|
void |
setCampaignKey(CampaignKey aCampaignKey)
Sets the campaignKey.
|
void |
setCheckTargetingConditionAtRuntime(boolean aCheckTargetingConditionAtRuntime)
Sets the the boolean value of checking targeting condition at runtime.
|
void |
setCode(java.lang.String visualCue)
Sets the visualCue.
|
void |
setCodeCouponPerOrderLimit(int codeCouponPerOrderLimit)
Sets the limit of how many times unique promotion codes can give
adjustments for the same promotion.
|
void |
setCorrespondingRBDTypeName(java.lang.String string)
Deprecated.
This method is intended for internal usage.
|
void |
setCouponAttribute(com.ibm.commerce.marketing.promotion.CouponAttribute aCouponAttribute)
Sets the coupon attributes associated with the promotion.
|
void |
setCurrency(java.lang.String aCurrency)
Sets the currency.
|
void |
setCustomConditions(java.util.Vector restrictions)
Sets the other restrictions that may be added.
|
void |
setDescription(Description aDescription)
Sets the description of the promotion.
|
void |
setDescription(java.util.Locale aLocale,
int aType,
java.lang.String aDescription)
Sets the specified type of the description of the promotion in a particular locale.
|
void |
setExclusiveLevel(int anExclusive)
Sets the exclusive level.
|
void |
setGroupKey(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey aKey)
Sets the group this promotion belongs to.
|
void |
setIgnoreTargetingConditionUponProperPromotionCodeEntry(boolean ignore)
Sets to ignore targeting condition upon a correct code entry.
|
void |
setKey(PromotionKey akey)
Sets the key of the promotion.
|
void |
setLastUpdate(java.util.Date aLastUpdate)
Sets the last update date of the promotion.
|
void |
setLastUpdateBy(CustomerKey aLastUpdateBy)
Sets the customer key representing who last update the promotion.
|
void |
setPerOrderLimit(int aPerOrderLimit)
Sets the per order redemption limit.
|
void |
setPerShopperLimit(int aPerShopperLimit)
Sets the the maximum number of times a promotion can be
applied to any shopper.
|
void |
setPriority(java.lang.Integer aPriority)
Sets the priority.
|
void |
setPromotionCodeCondition(Condition aPromotionCodeCondition)
Sets the promotion code condition.
|
void |
setPromotionCodeRequired(boolean aPromotionCodeRequired)
Sets if promotion code is required.
|
void |
setPurchaseCondition(Condition aPurchaseCondition)
Sets the purchaseCondition.
|
void |
setSchedule(Schedule aSchedule)
Sets the schedule of the promotion.
|
void |
setStatus(int aStatus)
Sets the status of the promotion.
|
void |
setTargetingCondition(Condition aTargetingCondition)
Sets the targeting condition.
|
void |
setTargetSales(java.math.BigDecimal decimal)
Sets the target sales figure, null is allowed
|
void |
setTotalApplicationCountLimit(int aTotalApplicationCountLimit)
Sets the limit of how many times a promotion can be redeemed
overall.
|
void |
setType(int aType)
Sets the type of promotion.
0: targeted 1: private |
java.lang.String |
toString() |
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public PromotionKey getKey()
public java.lang.String getDescription(java.util.Locale alocale, int atype)
getDescription
in interface Promotion
alocale
- The Locale
of the description to be returned.atype
- The type of the description to be returned.public int getExclusiveLevel()
getExclusiveLevel
in interface Promotion
public java.util.Date getLastUpdate()
getLastUpdate
in interface Promotion
public CustomerKey getLastUpdateBy()
getLastUpdateBy
in interface Promotion
public java.lang.String getName()
public java.lang.Integer getPriority()
getPriority
in interface Promotion
public Schedule getSchedule()
getSchedule
in interface Promotion
public int getStatus()
public void setDescription(java.util.Locale aLocale, int aType, java.lang.String aDescription)
setDescription
in interface Promotion
aLocale
- The Locale
of the description to be set.aType
- The type of the description to be set.aDescription
- The description to set.public void setExclusiveLevel(int anExclusive)
setExclusiveLevel
in interface Promotion
anExclusive
- The int representing an exclusive level to set.public void setKey(PromotionKey akey)
public void setLastUpdate(java.util.Date aLastUpdate)
setLastUpdate
in interface Promotion
aLastUpdate
- The last update date to setpublic void setLastUpdateBy(CustomerKey aLastUpdateBy)
setLastUpdateBy
in interface Promotion
aLastUpdateBy
- The customer key representing who last update the promotion.public void setPriority(java.lang.Integer aPriority)
setPriority
in interface Promotion
aPriority
- The priority to setpublic void setSchedule(Schedule aSchedule)
setSchedule
in interface Promotion
aSchedule
- The schedule to set for a promotion.public void setStatus(int aStatus)
public Condition getPromotionCodeCondition()
getPromotionCodeCondition
in interface Promotion
public Condition getTargetingCondition()
getTargetingCondition
in interface Promotion
public void setPromotionCodeCondition(Condition aPromotionCodeCondition)
setPromotionCodeCondition
in interface Promotion
aPromotionCodeCondition
- The promotion code condition to set.public void setTargetingCondition(Condition aTargetingCondition)
setTargetingCondition
in interface Promotion
aTargetingCondition
- The targeting condition to set.public boolean ignoreTargettingConditionUponProperPromotionCodeEntry()
ignoreTargettingConditionUponProperPromotionCodeEntry
in interface Promotion
public void setIgnoreTargetingConditionUponProperPromotionCodeEntry(boolean ignore)
setIgnoreTargetingConditionUponProperPromotionCodeEntry
in interface Promotion
ignore
- to ignore targeting condition upon a correct code entry.public void addCustomCondition(Condition aRestriction)
addCustomCondition
in interface Promotion
aRestriction
- The custom condition to add.public java.util.Iterator getCustomConditions()
getCustomConditions
in interface Promotion
Iterator
of custom conditions.public com.ibm.commerce.marketing.promotion.group.PromotionGroupKey getGroupKey()
getGroupKey
in interface Promotion
public void setGroupKey(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey aKey)
setGroupKey
in interface Promotion
aKey
- Sets the group that this promotion belongs to.public int getPerOrderLimit()
getPerOrderLimit
in interface Promotion
public int getPerShopperLimit()
getPerShopperLimit
in interface Promotion
public int getTotalApplicationCountLimit()
getTotalApplicationCountLimit
in interface Promotion
public int getCodeCouponPerOrderLimit()
public void setCustomConditions(java.util.Vector restrictions)
setCustomConditions
in interface Promotion
restrictions
- The other restrictions that may be added.public void setPerOrderLimit(int aPerOrderLimit)
setPerOrderLimit
in interface Promotion
aPerOrderLimit
- The per order redemption limit to set.public void setPerShopperLimit(int aPerShopperLimit)
setPerShopperLimit
in interface Promotion
aPerShopperLimit
- The maximum number of times a promotion can be
applied to any shopper to set.public void setTotalApplicationCountLimit(int aTotalApplicationCountLimit)
setTotalApplicationCountLimit
in interface Promotion
aTotalApplicationCountLimit
- The limit of how many times a promotion can be redeemed
overall to set.public void setCodeCouponPerOrderLimit(int codeCouponPerOrderLimit)
codeCouponPerOrderLimit
- The limit of how many unique promotion codes can give adjustments
for the same promotion.public void fromXML(org.w3c.dom.Node node) throws DeXMLizationException
XMLizable
fromXML
in interface XMLizable
node
- The node that represents an XMLizable objectDeXMLizationException
- when this process failsXMLizable.fromXML(Node)
public java.lang.String toXML() throws XMLizationException
XMLizable
toXML
in interface XMLizable
XMLizationException
- when this process failsXMLizable.toXML()
public int getRevision()
getRevision
in interface Promotion
public int getType()
public int getVersion()
getVersion
in interface Promotion
public void setType(int aType)
public java.lang.String getCode()
public void setCode(java.lang.String visualCue)
public boolean isPromotionCodeRequired()
isPromotionCodeRequired
in interface Promotion
public void setPromotionCodeRequired(boolean aPromotionCodeRequired)
setPromotionCodeRequired
in interface Promotion
aPromotionCodeRequired
- if promotion code is required.public Condition getPurchaseCondition()
getPurchaseCondition
in interface Promotion
public void setPurchaseCondition(Condition aPurchaseCondition)
setPurchaseCondition
in interface Promotion
aPurchaseCondition
- The purchase condition to set. Purchase condition is the
condition that governs certain purchases the customer has
to make in order to qualify for a promotion.public java.lang.String getCurrency()
getCurrency
in interface Promotion
public void setCurrency(java.lang.String aCurrency)
setCurrency
in interface Promotion
aCurrency
- The currency to set.public CampaignKey getCampaignKey()
getCampaignKey
in interface Promotion
public void setCampaignKey(CampaignKey aCampaignKey)
setCampaignKey
in interface Promotion
aCampaignKey
- The campaignKey to set. The campaign key points to the campaign
to which this promotion belongs to. This relationship is optional.public void addExemptedPolicy(PromotionPolicyKey aKey)
addExemptedPolicy
in interface Promotion
aKey
- the key of the exempted policy to be added.public void removeExemptedPolicy(PromotionPolicyKey aKey)
removeExemptedPolicy
in interface Promotion
aKey
- the
key of the promotion policy to be removed.public java.util.Iterator getExemptedPolicies()
getExemptedPolicies
in interface Promotion
public void clearExemptedPolicyList()
public void addExplicitlyAppliedPolicy(PromotionPolicyKey aKey)
addExplicitlyAppliedPolicy
in interface Promotion
aKey
- the key of the applicable policy that to be added.public void removeExplicitlyAppliedPolicy(PromotionPolicyKey aKey)
removeExplicitlyAppliedPolicy
in interface Promotion
aKey
- the key of the promotion policy to be removed from the list.public java.util.Iterator getExplicitlyAppliedPolicies()
getExplicitlyAppliedPolicies
in interface Promotion
public void clearExplicitlyAppliedPolicyList()
public boolean checkTargetingConditionAtRuntime()
checkTargetingConditionAtRuntime
in interface Promotion
public void setCheckTargetingConditionAtRuntime(boolean aCheckTargetingConditionAtRuntime)
setCheckTargetingConditionAtRuntime
in interface Promotion
aCheckTargetingConditionAtRuntime
- The boolean value of checking targeting condition at runtime
to set.public com.ibm.commerce.marketing.promotion.CouponAttribute getCouponAttribute()
getCouponAttribute
in interface Promotion
public void setCouponAttribute(com.ibm.commerce.marketing.promotion.CouponAttribute aCouponAttribute)
setCouponAttribute
in interface Promotion
aCouponAttribute
- The coupon attributes associated with the promotion.public boolean evaluate(PromotionContext context) throws PromotionRuntimeException
evaluate
in interface Promotion
context
- PromotionContext object which serves as both the in and out
parameter to this method.PromotionRuntimeException
- if the evaluation process encounters any exception, the
exception will be wrapped in PromotionRuntimeException and
thrown to caller.public java.math.BigDecimal getTargetSales()
Promotion
getTargetSales
in interface Promotion
Promotion.getTargetSales()
public void setTargetSales(java.math.BigDecimal decimal)
Promotion
setTargetSales
in interface Promotion
decimal
- the target sales figurePromotion.setTargetSales(BigDecimal)
public java.lang.String getCorrespondingRBDTypeName()
getCorrespondingRBDTypeName
in interface Promotion
Promotion.getCorrespondingRBDTypeName()
public void setCorrespondingRBDTypeName(java.lang.String string)
setCorrespondingRBDTypeName
in interface Promotion
The
- discount type.Promotion.setCorrespondingRBDTypeName(String)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public Description getDescription()
public void setDescription(Description aDescription)
aDescription
- the description of the promotion to set.public java.util.List getAttributeNames()
public void setAttributeNames(java.util.List<java.lang.String> names)
names
- a list of names to be set to be the new rule list namespublic void clearAttributeNamesCache()