public class MarketingCampaignElementTaskCmdImpl extends com.ibm.websphere.command.CacheableCommandImpl implements MarketingCampaignElementTaskCmd
For a target:
validateParameters
to validate
the element during activity activation. The method checks that
all the required data has been provided and is correct.performExecute
and use the method
setReturnValue
to identify if the customer meets
the target criteria.For an action:
validateParameters
to validate
the element during activity activation. The method checks that
all the required data has been provided and is correct.performExecute
. If appropriate, use the method
addEMarketingSpotDataBean
to return data to
an e-Marketing Spot. Call the method setReturnValue(true)
unless the customer should not move past the action in the activity flow.For a trigger:
validateParameters
to validate
the element during activity activation. The method checks that
all the required data has been provided and is correct.forwardTriggersForProcessing()
to
determine the set of customers who should participate in the associated
dialog activity.The following techniques can be used to share data during the evaluation of an activity:
getTriggerParametersMap().put(Object, Object)
.
Campaign elements that are called after this campaign element in the e-Marketing
Spot evaluation (in the same web activity, as well as other web activities scheduled
to the e-Marketing Spot) will have access to the updated trigger parameters.
Campaign elements that are called after this campaign element in a dialog activity
(in the same dialog activity) will have access to the updated trigger parameters.
Updating the trigger parameters can effect the evaluation of the activity.
putTemporarySharedDataObject
,
and existing information can be retrieved by calling the method
getTemporarySharedDataObject
.
Campaign elements that are called after this campaign element in the e-Marketing
Spot evaluation (in the same web activity, as well as other web activities scheduled
to the e-Marketing Spot) will have access to the temporary shared data area.
Campaign elements that are called after this campaign element in a dialog activity
(in the same dialog activity) will have access to the temporary shared data area.
getPreviewReport().add(String)
.
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.
|
static java.lang.String |
DM_FROM_FORWARD_TRIGGERS_FOR_PROCESSING
A constant indicating that the dialog activity processing is coming from a batch dialog activity
like Customer Abandons Cart, Customer is in Segment, or Customer Birthday.
|
static java.lang.String |
EMLPROMO_NAME_PREFIX
The prefix used when creating email activities.
|
static java.lang.String |
GENERIC_USER_ID
Constant for the generic user id.
|
defaultCommandClassName
Constructor and Description |
---|
MarketingCampaignElementTaskCmdImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addEMarketingSpotDataBean(EMarketingSpotDataBean emsDataBean)
This method sets an
EMarketingSpotDataBean data bean
that contains the information of what to display in an e-Marketing Spot. |
void |
forwardTriggersForProcessing()
This method finds all the users associated with a Trigger element, and forwards the trigger
for each user.
|
void |
forwardTriggersForProcessing(java.util.List userList,
java.lang.Integer activityId,
java.lang.Integer campaignElementId,
java.lang.Integer storeId)
This method takes a list of users and forwards the trigger
for each user.
|
Activity |
getActivity()
This method gets the activity business object associated with the element.
|
java.lang.String |
getDataFromTriggerParameters(java.lang.String type)
This method gets the specified information from the trigger parameters.
|
java.lang.Integer |
getElementId()
This method gets the ID of the element.
|
java.util.Map |
getElementParameters()
This method gets the parameters to evaluate the target or perform the action.
|
java.util.List |
getEMarketingSpotDataBeans()
This method returns to the marketing services the list of
EMarketingSpotDataBean objects
that contain the information of what to display to the customer
in the e-Marketing Spot. |
java.util.List |
getExperimentTestElements()
This method gets the the set of experiments and test elements that have been passed along the activity flow.
|
MarketingContentType |
getMarketingContent(java.lang.String marketingContentId)
This method gets the marketing content business object for the input marketing content ID.
|
java.lang.String |
getMarketingSpotBehavior(java.util.Map elementParameters)
This method gets the caching behavior for the marketing campaign element
and how it should affect the e-Marketing Spot caching behavior.
|
java.lang.Long |
getMemberId()
This method gets the member ID of the current user.
|
java.lang.Long |
getMemberId(boolean excludeGenericUser)
This method gets the member ID of the current user.
|
java.lang.Long[] |
getMemberIdsForPersonalizationId()
This method returns the set of member IDs associated with the customer.
|
java.lang.Long[] |
getMemberIdsForPersonalizationId(boolean excludeGenericUser)
This method returns the set of member IDs associated with the customer.
|
java.util.Map |
getNewElementParameters()
This method gets the new element parameters that were created in the
DMELEMENTNVP table for this element during activation of the activity.
|
java.lang.String |
getPersonalizationId()
This method gets the personalization ID of the current user.
|
java.util.List |
getPreviewReport()
This method gets the list of information about the activity evaluation on the e-Marketing Spot.
|
java.lang.Long |
getRegisteredMemberIdForPersonalizationId()
This method returns the registered member ID associated with the customer.
|
boolean |
getReturnValue()
This method returns the return value set by the task command implementation.
|
java.lang.Integer |
getStoreId()
This method gets the ID of the current store.
|
java.util.Map |
getTemporarySharedData()
This method returns the map used to store temporary data that can be passed
between all the campaign elements when evaluating an e-Marketing Spot.
|
java.lang.Object |
getTemporarySharedDataObject(java.lang.String key)
This method gets the data stored in the temporary data map that is passed
between all the campaign elements when evaluating an e-Marketing Spot.
|
java.lang.String |
getTriggerParameters()
This methods gets the trigger parameters.
|
java.util.Map |
getTriggerParametersMap()
This methods gets the trigger parameters.
|
java.lang.String |
getUserDataForElement(java.lang.String personalizationId,
java.lang.String campaignElementId)
This method returns the string containing the customer's behavior for the specified campaign
element.
|
boolean |
isReadyToCallExecute()
This method returns true.
|
void |
performExecute()
This method performs no actions.
|
void |
putTemporarySharedDataObject(java.lang.String key,
java.lang.Object obj)
This method put data into the temporary data map that is passed
between all the campaign elements when evaluating an e-Marketing Spot.
|
void |
returnEMarketingSpotDataBeans()
This method returns to the marketing services the list of
EMarketingSpotDataBean objects
that contain the information of what to display to the customer
in the e-Marketing Spot. |
void |
setActivity(Activity newActivity)
This method sets the activity business object associated with the element.
|
void |
setElementId(java.lang.Integer newElementId)
This method sets the ID of the element.
|
void |
setElementParameters(java.util.Map newParameters)
This method sets the parameters associated with the element.
|
void |
setExperimentTestElements(java.util.List newExperimentTestElements)
This method sets the set of experiments and test elements that have been passed along the activity flow.
|
void |
setNewElementParameter(java.lang.String name,
java.lang.String value)
This method sets that a new element parameter has been created in the
DMELEMENTNVP table for this element during activation of the activity.
|
void |
setOutputProperties(com.ibm.websphere.command.TargetableCommand fromCommand)
Sets the output properties by copying them from another instance of this command.
|
void |
setPreviewReport(java.util.List newPreviewReport)
This method sets the list of information about the activity evaluation on the e-Marketing Spot.
|
void |
setReturnValue(boolean newValue)
This method sets the return value of the task command.
|
void |
setTemporarySharedData(java.util.Map newTemporarySharedData)
This method sets the map used to store temporary data that can be passed
between all the campaign elements when evaluating an e-Marketing Spot.
|
void |
setTriggerParameters(java.util.Map newTriggerParameters)
This method sets the trigger parameters.
|
void |
setTriggerParameters(java.lang.String newTriggerParameters)
This method sets the trigger parameters.
|
void |
validateCategory(java.lang.String categoryId,
java.util.List validationErrors)
This method validates that the specified category exists in the CATGROUP
database table.
|
void |
validateCustomerSegment(java.lang.String segmentId,
java.util.List validationErrors)
This method validates that the specified customer segment exists in the MBRGRP
database table.
|
void |
validateDates(java.util.Map elementParameters,
java.util.List validationErrors)
This method validates that the specified date parameters are valid.
|
void |
validateElementIsFirstInActivity(java.util.List validationErrors,
java.lang.String errorKey)
This method validates that the element is the first element in
the top level path of the activity flow definition.
|
void |
validateEmailTemplate(java.lang.String emailTemplateId,
java.util.List validationErrors)
This method validates that the specified e-mail template exists in the EMLMSG
database table.
|
void |
validateMarketingContent(MarketingContentType marketingContent,
java.util.List validationErrors)
This method validates that the specified marketing content exists.
|
void |
validateMarketingContent(java.lang.String marketingContentId,
java.util.List validationErrors)
This method validates that the specified marketing content exists in the COLLATERAL
database table.
|
void |
validateMarketingSpot(java.lang.String emsId,
java.util.List validationErrors)
This method validates that the specified eMarketing Spot exists in the EMSPOT
database table.
|
java.util.List |
validateParameters(java.util.Map elementParameters)
This method validates that all the required name value pairs have been set for
the campaign element.
|
void |
validateProduct(java.lang.String catalogEntryId,
java.util.List validationErrors)
This method validates that the specified product exists in the CATENTRY
database table.
|
void |
validatePromotion(java.lang.String promotionId,
java.util.List validationErrors)
This method validates that the specified promotion exists in the PX_PROMOTION database table.
|
void |
validatePromotionCodes(java.lang.String promotionId,
boolean hasExactlyOneCode,
java.util.List validationErrors)
This method validates that the specified promotion exists, and that it is of code type.
|
void |
validatePromotionCodesOrCoupon(java.lang.String promotionId,
boolean hasExactlyOneCode,
java.util.List validationErrors,
boolean allowCouponPromotion)
This method validates that the specified promotion exists, and that it is of code type.
|
void |
validatePromotionCoupon(java.lang.String promotionId,
java.util.List validationErrors)
This method validates that the specified promotion exists, and that it is of type coupon.
|
void |
validatePromotionDisplay(java.lang.String promotionId,
java.util.List validationErrors)
This method validates that the specified promotion exists, and that if
the promotion requires a promotion code, then the
promotion specifies one and only one code.
|
boolean |
validateSubscription(java.lang.String catalogEntryId,
java.util.List validationErrors)
This method validates that the specified subscription catentry exists in the CATENTRY
database table.
|
void |
validateTimes(java.util.Map elementParameters,
java.util.List validationErrors)
This method validates that the specified number of times parameters are valid.
|
execute, executeFromCache, getCaller, getEntryInfo, getId, getObjectSize, getSharingPolicy, postExecute, preExecute, reset, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
public static final java.lang.String COPYRIGHT
public static final java.lang.String CLASSNAME
public static final java.lang.String EMLPROMO_NAME_PREFIX
public static final java.lang.String DM_FROM_FORWARD_TRIGGERS_FOR_PROCESSING
public static final java.lang.String GENERIC_USER_ID
public java.lang.String getTriggerParameters()
public java.util.Map getTriggerParametersMap()
public Activity getActivity()
public java.lang.Integer getElementId()
public java.util.Map getElementParameters()
public java.util.List getExperimentTestElements()
public void setElementParameters(java.util.Map newParameters)
DMELEMENTNVP
database table.setElementParameters
in interface MarketingCampaignElementTaskCmd
newParameters
- The name value pairs available to the task command implementation.public void setExperimentTestElements(java.util.List newExperimentTestElements)
setExperimentTestElements
in interface MarketingCampaignElementTaskCmd
newExperimentTestElements
- The set of experiments and test elements that have been passed along the activity flow.public boolean getReturnValue()
getReturnValue
in interface MarketingCampaignElementTaskCmd
public void setReturnValue(boolean newValue)
setReturnValue
in interface MarketingCampaignElementTaskCmd
newValue
- The return value of the task command.public void setTriggerParameters(java.lang.String newTriggerParameters)
setTriggerParameters
in interface MarketingCampaignElementTaskCmd
newTriggerParameters
- The trigger parameters from the current request.public void setTriggerParameters(java.util.Map newTriggerParameters)
setTriggerParameters
in interface MarketingCampaignElementTaskCmd
newTriggerParameters
- The trigger parameters from the current request.public void setTemporarySharedData(java.util.Map newTemporarySharedData)
setTemporarySharedData
in interface MarketingCampaignElementTaskCmd
newTemporarySharedData
- The map of temporary data to share between campaign elements.public java.util.Map getTemporarySharedData()
public java.lang.Object getTemporarySharedDataObject(java.lang.String key)
key
- The cache key to use when getting and putting data in
the temporary shared data map.public void putTemporarySharedDataObject(java.lang.String key, java.lang.Object obj)
key
- The cache key to use when getting and putting data in
the temporary shared data map.obj
- The data to store in the temporary data map under the specified key.public void setActivity(Activity newActivity)
setActivity
in interface MarketingCampaignElementTaskCmd
newActivity
- The activity business object associated with the element.public void setElementId(java.lang.Integer newElementId)
setElementId
in interface MarketingCampaignElementTaskCmd
newElementId
- The ID of the element.public java.lang.Integer getStoreId()
public java.lang.String getPersonalizationId()
public java.lang.Long getMemberId()
public java.lang.Long getMemberId(boolean excludeGenericUser)
excludeGenericUser
is true, then this method will not return a value if the current user is the generic user (-1002).
If the parameter excludeGenericUser
is false, then this method may return the generic
user member ID.excludeGenericUser
- If this is true, do not return a value if the user is the generic user.public java.lang.Long[] getMemberIdsForPersonalizationId()
public java.lang.Long[] getMemberIdsForPersonalizationId(boolean excludeGenericUser)
excludeGenericUser
is true, then this method will not return the generic user (-1002) in the member ID list.
If the parameter excludeGenericUser
is false, then this method may return the generic
user member ID in the returned member ID list.excludeGenericUser
- If this is true, do not include the generic user.public java.lang.Long getRegisteredMemberIdForPersonalizationId()
public void performExecute()
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class com.ibm.websphere.command.TargetableCommandImpl
public java.util.List validateParameters(java.util.Map elementParameters)
validateParameters
in interface MarketingCampaignElementTaskCmd
elementParameters
- The name value pairs for this element.ApplicationError
exceptions
that contains any validation errors. The list may be empty or be null
.public boolean isReadyToCallExecute()
isReadyToCallExecute
in interface com.ibm.websphere.command.Command
isReadyToCallExecute
in class com.ibm.websphere.command.TargetableCommandImpl
public java.lang.String getUserDataForElement(java.lang.String personalizationId, java.lang.String campaignElementId)
personalizationId
- The customer's personalization ID.campaignElementId
- The ID of the flow element for which we want the customer's behavior.public void validateMarketingSpot(java.lang.String emsId, java.util.List validationErrors)
emsId
- The ID of the eMarketing Spot to verify.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validateCategory(java.lang.String categoryId, java.util.List validationErrors)
categoryId
- The ID of the category to verify.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validateProduct(java.lang.String catalogEntryId, java.util.List validationErrors)
catalogEntryId
- The ID of the product to verify.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public boolean validateSubscription(java.lang.String catalogEntryId, java.util.List validationErrors)
catalogEntryId
- The ID of the subscription catentry to verify.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public MarketingContentType getMarketingContent(java.lang.String marketingContentId)
marketingContentId
- The ID of the marketing contentpublic void validateMarketingContent(java.lang.String marketingContentId, java.util.List validationErrors)
marketingContentId
- The ID of the marketing content to verify.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validateMarketingContent(MarketingContentType marketingContent, java.util.List validationErrors)
marketingContent
- The marketing content to verify.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validateEmailTemplate(java.lang.String emailTemplateId, java.util.List validationErrors)
emailTemplateId
- The ID of the e-mail template to verify.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validateCustomerSegment(java.lang.String segmentId, java.util.List validationErrors)
segmentId
- The ID of the customer segment to verify.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validatePromotion(java.lang.String promotionId, java.util.List validationErrors)
promotionId
- The ID of the promotion to verify.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validatePromotionDisplay(java.lang.String promotionId, java.util.List validationErrors)
promotionId
- The ID of the promotion to verify.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validatePromotionCoupon(java.lang.String promotionId, java.util.List validationErrors)
promotionId
- The ID of the promotion to verify.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validatePromotionCodes(java.lang.String promotionId, boolean hasExactlyOneCode, java.util.List validationErrors)
promotionId
- The ID of the promotion to verify.hasExactlyOneCode
- Check that this promotion has exactly one promotion code.
This condition is checked only if the promotion is a code promotion.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validatePromotionCodesOrCoupon(java.lang.String promotionId, boolean hasExactlyOneCode, java.util.List validationErrors, boolean allowCouponPromotion)
allowCouponPromotion
is true, then the promotion may also be of coupon type.promotionId
- The ID of the promotion to verify.hasExactlyOneCode
- Check that this promotion has exactly one promotion code.
This condition is checked only if the promotion is a code promotion.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.allowCouponPromotion
- Check that this promotion is a coupon promotion.public void validateDates(java.util.Map elementParameters, java.util.List validationErrors)
elementParameters
- The name value pairs for this element.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validateTimes(java.util.Map elementParameters, java.util.List validationErrors)
elementParameters
- The name value pairs for this element.validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.public void validateElementIsFirstInActivity(java.util.List validationErrors, java.lang.String errorKey)
validationErrors
- The list of ApplicationError
exceptions
that contains any validation errors. The list may be empty.errorKey
- The error key message to use if the element is not the first in the activitypublic void addEMarketingSpotDataBean(EMarketingSpotDataBean emsDataBean)
EMarketingSpotDataBean
data bean
that contains the information of what to display in an e-Marketing Spot.
The following is an example of how to create the EMarketingSpotDataBean
to pass to this method.
EMarketingSpotDataBean emsDataBean = new EMarketingSpotDataBean( "MyCustomDataType", "dataValue", getActivity(), getElementId(), getExperimentTestElements()); addEMarketingSpotDataBean(emsDataBean);
For example, to return content with a COLLATERAL_ID of 12345:
EMarketingSpotDataBean emsDataBean = new EMarketingSpotDataBean( EMarketingSpotDataBean.DISPLAY_TYPE_MARKETING_CONTENT, "12345", activity, getElementId(), getExperimentTestElements()); addEMarketingSpotDataBean(emsDataBean);The information in the
EMarketingSpotDataBean
data bean is used to populate the
BaseMarketingSpotActivityDataType
SDO. For the supported out of the
box data types (CatalogEntry, CatalogGroup, MarketingContent), then the information
is also used to populate the applicable SDO (MarketingSpotActivityCatalogEntryDataType
,
MarketingSpotActivityCatalogGroupDataType
, MarketingSpotActivityMarketingContentDataType
that extends from BaseMarketingSpotActivityDataType
).
If additional data needs to be returned to the e-Marketing Spot,
then this method can be extended, and the method EMarketingSpotDataBean.setNVP
can be used to set additional data into
the data bean. This data will be available from the getProperties
method
of the SDO returned to the e-Marketing Spot JSP snippet.
For example, a campaign element extension can implement this method.
public void addEMarketingSpotDataBean(EMarketingSpotDataBean emsDataBean) {
emsDataBean.setNVP("abc", "123");
emsDataBean.setNVP("def", "456");
super.addEMarketingSpotDataBean(emsDataBean);
}
On the e-Marketing Spot JSP snippet, the individual data can be retrieved:
${marketingSpotData.properties['abc']}
${marketingSpotData.properties['def']}
or all the data can be retrieved:
<c:forEach var="nvp" items="${marketingSpotData.properties}" >
<c:out value="${nvp.key}: ${nvp.value}" escapeXml="false" / >
</c:forEach >
emsDataBean
- The EMarketingSpotDataBean
object.public void returnEMarketingSpotDataBeans()
EMarketingSpotDataBean
objects
that contain the information of what to display to the customer
in the e-Marketing Spot.
The method addEMarketingSpotDataBean
should be called by the campaign element task command
with each EMarketingSpotDataBean
.
This method is no longer used. The marketing services call the method getEMarketingSpotDataBeans
.returnEMarketingSpotDataBeans
in interface MarketingCampaignElementTaskCmd
public java.util.List getEMarketingSpotDataBeans()
EMarketingSpotDataBean
objects
that contain the information of what to display to the customer
in the e-Marketing Spot.
The method addEMarketingSpotDataBean
should be called by the campaign element task command
with each EMarketingSpotDataBean
.
The marketing services will call this method to process the data beans that have been set
by the task command.getEMarketingSpotDataBeans
in interface MarketingCampaignElementTaskCmd
EMarketingSpotDataBean
objects.public java.lang.String getDataFromTriggerParameters(java.lang.String type)
type
- The type of information to retrieve. It can be one of the following:
public void forwardTriggersForProcessing()
forwardTriggersForProcessing
in interface MarketingCampaignElementTaskCmd
public void forwardTriggersForProcessing(java.util.List userList, java.lang.Integer activityId, java.lang.Integer campaignElementId, java.lang.Integer storeId)
userList
- The list with the customer information. Every element in the list is
a child-list; In the child-list, the 1st element is the customer's
member ID, and the 2nd element is the customer's personalization ID.activityId
- The activity for which to forward the trigger.campaignElementId
- The campaign element ID for which to forward the trigger.storeId
- The store ID associated with the activity.public void setPreviewReport(java.util.List newPreviewReport)
setPreviewReport
in interface MarketingCampaignElementTaskCmd
newPreviewReport
- A list of information about the activity evaluation on the e-Marketing Spot..public java.util.List getPreviewReport()
public void setOutputProperties(com.ibm.websphere.command.TargetableCommand fromCommand)
Sets the output properties by copying them from another instance of this command.
This method is intended to be called by the cacheable command framework. Do not call this method directly.
setOutputProperties
in interface com.ibm.websphere.command.TargetableCommand
setOutputProperties
in class com.ibm.websphere.command.TargetableCommandImpl
TargetableCommand.setOutputProperties(com.ibm.websphere.command.TargetableCommand)
public java.lang.String getMarketingSpotBehavior(java.util.Map elementParameters)
getMarketingSpotBehavior
in interface MarketingCampaignElementTaskCmd
elementParameters
- The name value pairs for this element.public java.util.Map getNewElementParameters()
getNewElementParameters
in interface MarketingCampaignElementTaskCmd
public void setNewElementParameter(java.lang.String name, java.lang.String value)
setNewElementParameter
in interface MarketingCampaignElementTaskCmd
name
- The name of the name-value pair.value
- The value of the name-value pair.