public class MarketingCampaignElementTaskCmdImpl extends com.ibm.websphere.command.CacheableCommandImpl implements MarketingCampaignElementTaskCmd
For a target:
For an action:
For a trigger:
The following techniques can be used to share data during the evaluation of an activity:
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.
|
protected static java.lang.String | PARAM_DAYS_OPERATOR
Parameter for days operator.
|
protected static java.lang.String | PARAM_NUMBER_OF_TIMES
Parameter for number of times.
|
protected static java.lang.String | PARAM_NUMBER_OF_TIMES_OPERATOR
Parameter for number of times operator.
|
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.
|
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
protected static final java.lang.String PARAM_NUMBER_OF_TIMES
protected static final java.lang.String PARAM_DAYS_OPERATOR
protected static final java.lang.String PARAM_NUMBER_OF_TIMES_OPERATOR
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)
public void setExperimentTestElements(java.util.List newExperimentTestElements)
public boolean getReturnValue()
public void setReturnValue(boolean newValue)
public void setTriggerParameters(java.lang.String newTriggerParameters)
public void setTriggerParameters(java.util.Map newTriggerParameters)
public void setTemporarySharedData(java.util.Map newTemporarySharedData)
public java.util.Map getTemporarySharedData()
public java.lang.Object getTemporarySharedDataObject(java.lang.String key)
public void putTemporarySharedDataObject(java.lang.String key, java.lang.Object obj)
public void setActivity(Activity newActivity)
public void setElementId(java.lang.Integer newElementId)
public java.lang.Integer getStoreId()
public java.lang.String getPersonalizationId()
public java.lang.Long getMemberId()
public java.lang.Long getMemberId(boolean excludeGenericUser)
public java.lang.Long[] getMemberIdsForPersonalizationId()
public java.lang.Long[] getMemberIdsForPersonalizationId(boolean excludeGenericUser)
public java.lang.Long getRegisteredMemberIdForPersonalizationId()
public void performExecute()
public java.util.List validateParameters(java.util.Map elementParameters)
public boolean isReadyToCallExecute()
public java.lang.String getUserDataForElement(java.lang.String personalizationId, java.lang.String campaignElementId)
public void validateMarketingSpot(java.lang.String emsId, java.util.List validationErrors)
public void validateCategory(java.lang.String categoryId, java.util.List validationErrors)
public void validateProduct(java.lang.String catalogEntryId, java.util.List validationErrors)
public boolean validateSubscription(java.lang.String catalogEntryId, java.util.List validationErrors)
public MarketingContentType getMarketingContent(java.lang.String marketingContentId)
public void validateMarketingContent(java.lang.String marketingContentId, java.util.List validationErrors)
public void validateMarketingContent(MarketingContentType marketingContent, java.util.List validationErrors)
public void validateEmailTemplate(java.lang.String emailTemplateId, java.util.List validationErrors)
public void validateCustomerSegment(java.lang.String segmentId, java.util.List validationErrors)
public void validatePromotion(java.lang.String promotionId, java.util.List validationErrors)
public void validatePromotionDisplay(java.lang.String promotionId, java.util.List validationErrors)
public void validatePromotionCoupon(java.lang.String promotionId, java.util.List validationErrors)
public void validatePromotionCodes(java.lang.String promotionId, boolean hasExactlyOneCode, java.util.List validationErrors)
public void validatePromotionCodesOrCoupon(java.lang.String promotionId, boolean hasExactlyOneCode, java.util.List validationErrors, boolean allowCouponPromotion)
public void validateDates(java.util.Map elementParameters, java.util.List validationErrors)
public void validateTimes(java.util.Map elementParameters, java.util.List validationErrors)
public void validateElementIsFirstInActivity(java.util.List validationErrors, java.lang.String errorKey)
public void addEMarketingSpotDataBean(EMarketingSpotDataBean emsDataBean)
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 >
public void returnEMarketingSpotDataBeans()
public java.util.List getEMarketingSpotDataBeans()
public java.lang.String getDataFromTriggerParameters(java.lang.String type)
public void forwardTriggersForProcessing()
public void forwardTriggersForProcessing(java.util.List userList, java.lang.Integer activityId, java.lang.Integer campaignElementId, java.lang.Integer storeId)
public void setPreviewReport(java.util.List newPreviewReport)
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.
public java.lang.String getMarketingSpotBehavior(java.util.Map elementParameters)
public java.util.Map getNewElementParameters()
public void setNewElementParameter(java.lang.String name, java.lang.String value)