public class MarketingEngineCache
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.Integer |
ACTIVITY_FOR_DEFAULT_CONTENT
A constant for the ID of the activity when the default content is displayed
in an eMarketing Spot.
|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
static java.lang.String |
PROCESS_ON_COMMAND_EVENT_NAME
The event name used for marketing events for the Command Execution Trigger Registry
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
buildBehaviorRuleKey(java.lang.Integer elementTypeId,
java.lang.String command,
java.lang.Integer storeId)
This method constructs a key to find
UserBehaviorRule objects in the cache. |
static void |
checkBehaviorRulesLoaded(boolean fromSensor)
The method checks if the behavior rules have been loaded into the cache.
|
void |
clearAll()
This method removes all the data from all the caches.
|
void |
clearEMarketingSpotFromRegistry(java.lang.String name,
java.lang.String usage,
java.lang.Integer storeId,
java.lang.Integer emsId)
This method clears entries associated with an e-Marketing Spot from the cache.
|
void |
clearMarketingCache()
This method removes all the data from the marketing cache.
|
void |
clearUserBehaviorCache()
This method removes all the data from the user behavior cache.
|
boolean |
filterCommandBasedOnWebpath(java.lang.String commandName,
java.lang.String webpath)
This method checks if a the successful exit of a command should be ignored
because it was called from a webapp for which we do not want to process
events.
|
void |
flushRankingStatisticsCache()
This method will persist all the ranking statistics that are in
the ranking statistic cache to the database with a batch insert SQL.
|
void |
flushUserBehaviorBatchUpdateCache()
This method will persist all the user behavior entries that are in
the user behavior batch update cache to the database.
|
Activity |
getActivity(java.lang.Integer activityId)
This method returns an
Activity object based on an activityId . |
Activity |
getActivityFromElementId(java.lang.Integer elementId)
This method gets the Activity business object associated with an element.
|
java.util.Map |
getBehaviorRules()
This method returns the behavior rule cache.
|
java.util.List |
getBehaviorRules(java.lang.String key)
This method looks in the cache for behavior rules that match the given key.
|
java.util.List |
getBehaviorRules(java.lang.String command,
java.lang.Integer storeId,
java.util.Map urlString,
java.lang.String referralURL,
java.lang.Integer elementTypeId)
This method looks in the cache for behavior rules that match the command, store and urlString (NVPs) passed in.
|
java.util.List |
getBehaviorRules(java.lang.String command,
java.lang.Integer storeId,
java.lang.String urlString,
java.lang.String referralURL,
java.lang.Integer elementTypeId)
This method looks in the cache for behavior rules that match the command, store and urlString (NVPs) passed in.
|
static java.lang.String |
getCacheStringFromFlowElement(FlowElement element)
This method returns a string representation of a flow element.
|
static boolean |
getCurrentCmcVersionIsFEP6orHigher()
This method returns if the CMC feature is currently at FEP6 or higher.
|
static boolean |
getCurrentFoundationVersionIsFEP6()
This method returns if the foundation feature is currently at FEP6.
|
static java.lang.String |
getElementUniqueIdFromElementName(java.lang.String elementName,
java.lang.Integer activityId)
This method gets the unique ID of a campaign element based on the name of
the element.
|
static java.lang.String |
getElementUniqueIdFromElementName(java.lang.String elementName,
java.lang.String activityName)
This method gets the unique ID of a campaign element based on the name of
the element.
|
CampaignInitiativeCache.CachedEMarketingSpot |
getEmarketingSpot(java.lang.String name,
java.lang.String usage,
java.lang.Integer storeId)
This method gets the definition of an e-Marketing Spot.
|
java.util.List |
getEMarketingSpotActivities(java.lang.String emsId,
java.lang.Integer storeId)
This method finds the set of activities that are scheduled on an e-Marketing Spot.
|
java.util.Map |
getEmarketingSpotRelatedInfo(java.lang.Integer emsId,
java.lang.Integer storeId)
This method gets the information related to an e-Marketing Spot in a
specific store.
|
static java.lang.Integer |
getExistingElementUniqueIdFromElementName(java.lang.String elementName,
java.lang.Integer activityId)
This method gets the unique ID of a campaign element based on the name of
the element.
|
FlowElement |
getFlowElement(java.lang.String elementId)
This method returns a
FlowElement object based on the elementId
found in the flow XML definition associated with an activity. |
java.util.List |
getMarketingSpotDefaultContent(java.lang.Integer storeId,
java.lang.Integer emsId)
This method gets the cached default content associated with
an e-Marketing spot in a specific store.
|
java.util.List |
getMarketingSpotDefaultContentForSingleStore(java.lang.Integer storeId,
java.lang.Integer emsId)
This method gets the default content entry associated with the e-Marketing
spot in the specified store.
|
java.util.List |
getMarketingSpotDefaultTitleContent(java.lang.Integer storeId,
java.lang.Integer emsId)
This method gets the cached default title content associated with
an e-Marketing spot in a specific store.
|
java.util.List |
getMarketingSpotDefaultTitleContentForSingleStore(java.lang.Integer storeId,
java.lang.Integer emsId)
This method gets the default title content entry associated with the e-Marketing
spot in the specified store.
|
java.lang.String |
getMarketingSpotOrderingInterface(java.lang.Integer storeId,
java.lang.Integer emsId,
java.lang.String contentType)
This method gets the cached interface name for the command to order content in
an eMarketing spot in a specific store.
|
java.lang.String |
getPromotionIdFromName(java.lang.String promoName)
This method returns the promotion ID based on an promotion name.
|
java.util.Map |
getSearchEMarketingSpots(java.lang.Integer storeId)
This method returns the search e-Marketing Spots that are currently defined
for the specified store and the stores on the campaigns store path.
|
java.util.List |
getTriggerListeners(java.lang.String triggerType,
java.lang.Integer storeId,
java.util.Map nvps)
This method looks up cached
TriggerListen objects that correspond to
activities that are listening for the trigger indicated by the method's parameters. |
com.ibm.commerce.marketing.internal.runtime.objects.UserBehavior |
getUserBehavior(java.lang.String personalizationId,
java.lang.Integer storeId)
This method returns an
UserBehavior object based on the personalizationId
for a customer. |
static java.lang.String |
getXmlStringFromActivityCache(com.ibm.commerce.marketing.internal.runtime.objects.ActivityRootElement activityRootElement)
This method returns a string representation of the cached object representing
the activity flow XML.
|
static java.lang.StringBuffer |
getXmlStringFromElement(com.ibm.commerce.marketing.internal.runtime.objects.ActivityFlowElement[] children)
This method returns a string representation of the cached objects representing
the flow elements in the activity XML.
|
void |
initialize()
This method initializes the marketing engine cache.
|
static void |
invalidateBehaviorRulesLoadedIndicator()
This method should be called when the behavior rules need to be updated in the marketing cache.
|
void |
invalidateEMarketingSpotActivities(java.lang.String emsId,
java.lang.Integer storeId)
This method removes a trigger listener object from the cache.
|
static boolean |
isInitialized()
This method returns if the singleton
MarketingEngineCache object has been initialized. |
static void |
loadBehaviorRulesByServiceCall()
This method calls a service to load the existing behavior rules.
|
java.util.List |
loadEMarketingSpotActivitiesFromDatabase(java.lang.String emsId,
java.lang.Integer storeId)
This method goes to the database and finds the set of activities that are scheduled on
an e-Marketing Spot.
|
static void |
loadExistingBehaviorRulesAndTriggerListeners(Activity activity,
com.ibm.commerce.marketing.internal.runtime.objects.ActivityElementData activityElementData,
com.ibm.commerce.marketing.internal.runtime.objects.TriggerListen[] triggerListeners)
This method will set up the cache so that is has the latest information about
behavior rules and trigger listeners for an activity.
|
static void |
loadExistingBehaviorRulesAndTriggerListeners(java.lang.Integer activityId)
This method will set up the cache so that is has the latest information about
behavior rules and trigger listeners for an activity.
|
void |
putBehaviorRule(java.lang.Integer storeId,
UserBehaviorRule ub,
java.lang.Integer elementTypeId)
This method adds a
UserBehaviorRule to the cache. |
void |
putRankingStatistic(java.lang.Long objectId,
java.lang.String groupId,
java.lang.Short objectType,
java.lang.Integer storeId,
java.lang.Integer elementId,
java.lang.Double amount)
This method sets up a ranking statistic entry to be persisted to the database.
|
void |
putTriggerListeners(java.lang.String triggerType,
java.lang.Integer storeId,
java.util.Map nvps,
com.ibm.commerce.marketing.internal.runtime.objects.TriggerListen triggerListen)
This method caches a given
TriggerListen object. |
void |
removeActivity(java.lang.Integer activityId)
This method removes an activity from the cache.
|
void |
removeElement(java.lang.Integer elementId)
This method removes a flow element from the cache.
|
void |
removeMarketingSpotDefaultContent(java.lang.Integer storeId,
java.lang.Integer emsId)
This method removes the default content entry associated with the e-Marketing
spot in the specified store.
|
void |
removeMarketingSpotTitle(java.lang.Integer storeId,
java.lang.Integer emsId)
This method removes the title entry associated with the e-Marketing
spot in the specified store.
|
Activity |
replaceActivity(java.lang.Integer activityId)
This method removes the existing
Activity object from the cache
and reloads the object into the cache from the definition in the database. |
FlowElement |
replaceFlowElement(java.lang.Integer elementId)
This method removes the existing
FlowElement object from the cache
and reloads the object into the cache from the definition in the database. |
void |
setActivity(com.ibm.commerce.marketing.internal.runtime.objects.ActivityElementData activityElementData,
Activity entry,
com.ibm.commerce.marketing.internal.runtime.objects.TriggerListen[] triggerListeners)
This method returns an
Activity object based on an activityId . |
void |
setFlowElement(FlowElement entry,
Activity activity,
com.ibm.commerce.marketing.internal.runtime.objects.ActivityElementData activityElementData)
This method updates the cache with the provided
FlowElement object. |
void |
setUserBehavior(java.lang.String personalizationId,
com.ibm.commerce.marketing.internal.runtime.objects.UserBehavior ub,
boolean existing,
boolean persistChanges)
This method updates a
UserBehavior object based on the personalizationId
for a customer in the cache and in the database. |
static void |
shutdown()
Call this method when the WC application is being shut down.
|
static MarketingEngineCache |
singleton()
This method returns a singleton
MarketingEngineCache object. |
public static final java.lang.String COPYRIGHT
public static final java.lang.String PROCESS_ON_COMMAND_EVENT_NAME
public static final java.lang.Integer ACTIVITY_FOR_DEFAULT_CONTENT
public Activity getActivityFromElementId(java.lang.Integer elementId)
elementId
- The ID of the element.public Activity replaceActivity(java.lang.Integer activityId)
Activity
object from the cache
and reloads the object into the cache from the definition in the database.activityId
- The activity ID for which to update the cache.Activity
object associated with an activity.public FlowElement replaceFlowElement(java.lang.Integer elementId)
FlowElement
object from the cache
and reloads the object into the cache from the definition in the database.
THIS METHOD IS NO LONGER USED.elementId
- The element ID for which to update the cache.FlowElement
object associated with an activity.public Activity getActivity(java.lang.Integer activityId)
Activity
object based on an activityId
.
If the activity cannot be found in the cache, it is loaded from the database and placed in the cache.
It parses the flow elements, and stores the ActivityFlowElement
objects in the Activity
object.activityId
- The activity ID for which to retrieve the activity.Activity
object associated with an activity.public FlowElement getFlowElement(java.lang.String elementId)
FlowElement
object based on the elementId
found in the flow XML definition associated with an activity. If the flow element cannot
be found in the cache, it is loaded from the database and placed in the cache. It parses
the flow element XML. For triggers, the type and name value pairs are stored in the
FlowElement
object. For targets and actions, the invocation
parameters are stored in the FlowElement
object.
THIS METHOD IS NO LONGER USED.elementId
- The element ID for which to retrieve the element.FlowElement
object associated with an activity.public static java.lang.String getXmlStringFromActivityCache(com.ibm.commerce.marketing.internal.runtime.objects.ActivityRootElement activityRootElement)
activityRootElement
- An object from the marketing cache that represents the activity flow XML.public static java.lang.StringBuffer getXmlStringFromElement(com.ibm.commerce.marketing.internal.runtime.objects.ActivityFlowElement[] children)
children
- An array of object from the marketing cache that represents the flow elements in the activity XML.public static java.lang.String getCacheStringFromFlowElement(FlowElement element)
element
- An flow element object.public void invalidateEMarketingSpotActivities(java.lang.String emsId, java.lang.Integer storeId)
emsId
- The ID of the e-Marketing Spot for which to remove the trigger listener cache entry.storeId
- The ID of the store in which to remove the trigger listener cache entry.public java.util.List loadEMarketingSpotActivitiesFromDatabase(java.lang.String emsId, java.lang.Integer storeId) throws java.lang.Exception
emsId
- The ID of the e-Marketing Spot for which to find the scheduled activities.storeId
- The ID of the store in which to find the scheduled activities.TriggerListen
business objects that
represent the activities that are scheduled on the e-Marketing Spot.java.lang.Exception
public java.util.List getEMarketingSpotActivities(java.lang.String emsId, java.lang.Integer storeId) throws java.lang.Exception
emsId
- The ID of the e-Marketing Spot for which to find the scheduled activities.storeId
- The ID of the store in which to find the scheduled activities.List
of TriggerListen
objects.java.lang.Exception
public void putTriggerListeners(java.lang.String triggerType, java.lang.Integer storeId, java.util.Map nvps, com.ibm.commerce.marketing.internal.runtime.objects.TriggerListen triggerListen)
TriggerListen
object.
The method assumes that this particular TriggerListen
object is not already cached.
The key into the TriggerListen
cache is composed of the triggerType, the storeId and the name/value pairs (NVPs) of
parameters that must exist on a request for that request to be picked up by the trigger listener.
For each unique key, the cache stores a List
which contains all TriggerListen
objects for that combination
of values. There can be multiple TriggerListen
objects for a single key.
THIS METHOD IS NO LONGER USED.triggerType
- The type of the trigger that the TriggerListen
wants to detect.storeId
- The ID of the store this TriggerListen
is for.nvps
- The Name/Value pairs that must be part of the request to qualify that it should be detected by this TriggerListen
.triggerListen
- The TriggerListen
object.public java.util.List getTriggerListeners(java.lang.String triggerType, java.lang.Integer storeId, java.util.Map nvps)
TriggerListen
objects that correspond to
activities that are listening for the trigger indicated by the method's parameters.
THIS METHOD IS NO LONGER USED.triggerType
- The type of the trigger to look for.storeId
- The ID of the store whose triggers to look through for matches.nvps
- This hashtable stores name-value pairs whose values must be same as the cached TriggerListen
object to qualify it as a match.List
of TriggerListen
objects.putTriggerListeners
public void initialize() throws java.lang.Exception
java.lang.Exception
public void removeActivity(java.lang.Integer activityId)
activityId
- The activity to remove from the cache.public void removeElement(java.lang.Integer elementId) throws java.lang.Exception
elementId
- The flow element to remove from the cache.java.lang.Exception
public void clearAll()
public void clearMarketingCache()
public void clearUserBehaviorCache()
public static java.lang.String[] buildBehaviorRuleKey(java.lang.Integer elementTypeId, java.lang.String command, java.lang.Integer storeId)
UserBehaviorRule
objects in the cache.elementTypeId
- The ID of the type of the campaign element template.command
- The current request command name.storeId
- The ID of the store.public void putBehaviorRule(java.lang.Integer storeId, UserBehaviorRule ub, java.lang.Integer elementTypeId)
UserBehaviorRule
to the cache.
The key for the UserBehaviorRule
consists of three things:
UserBehaviorRule
detects behavior for. The valid options are either
TYPE_TRIGGER
or TYPE_TARGET
.
List
of UserBehaviorRule
objects is stored. There can be
multiple UserBehaviorRule
objects for a single key.storeId
- The store the behavior rule applies to.ub
- A UserBehaviorRule
object that represents the user behavior XML.elementTypeId
- The type of the element for which the user's behavior is being detected. The valid options
are either TYPE_TRIGGER
or TYPE_TARGET
.public boolean filterCommandBasedOnWebpath(java.lang.String commandName, java.lang.String webpath)
commandName
- The name of the command.webpath
- The webpath from which the command is being called.public java.util.List getBehaviorRules(java.lang.String command, java.lang.Integer storeId, java.lang.String urlString, java.lang.String referralURL, java.lang.Integer elementTypeId)
TriggerOccurredForProcessing
), and the marketing runtime
has to determine if the event matches any of the current behavior rules. The current marketing runtime is using
the scenario where the external system (SensorEventListener
) has a copy of the rules, and it only sends the
triggers that match the current behavior rules. Similar code to this method can be found in the
SensorEventListener
class.
THIS METHOD IS NO LONGER USED.
The method getBehaviorRules
that has a Map for the urlString
is now called. This method calls
that method.command
- The command to look if there are matching behavior rules for.storeId
- The store to look for behavior rules for.urlString
- A URL string containing the parameters.referralURL
- The referral URL for the current request.elementTypeId
- The type of the element.List
which contains two List
s is returned. The two List
s contain:INDEX_UBRS
is a List
of UserBehaviorRule
objects that are waiting to record this command.INDEX_NVPS
is a List
of Hashtable
s where each hashtable
contains the Name/Value pairs that need to be detected
for the UserBehaviorRule
.
UserBehaviorRule
at matches.get(INDEX_UBRS).get(i)
are found at matches.get(INDEX_NVPS).get(i)
.public java.util.List getBehaviorRules(java.lang.String command, java.lang.Integer storeId, java.util.Map urlString, java.lang.String referralURL, java.lang.Integer elementTypeId)
TriggerOccurredForProcessing
), and the marketing runtime
has to determine if the event matches any of the current behavior rules. The current marketing runtime is using
the scenario where the external system (SensorEventListener
) has a copy of the rules, and it only sends the
triggers that match the current behavior rules. Similar code to this method can be found in the
SensorEventListener
class.command
- The command to look if there are matching behavior rules for.storeId
- The store to look for behavior rules for.urlString
- A map containing the parameters.referralURL
- The referral URL for the current request.elementTypeId
- The type of the element.List
which contains two List
s is returned. The two List
s contain:INDEX_UBRS
is a List
of UserBehaviorRule
objects that are waiting to record this command.INDEX_NVPS
is a List
of Hashtable
s where each hashtable
contains the Name/Value pairs that need to be detected
for the UserBehaviorRule
.
UserBehaviorRule
at matches.get(INDEX_UBRS).get(i)
are found at matches.get(INDEX_NVPS).get(i)
.public java.util.List getBehaviorRules(java.lang.String key)
key
- The key into the behavior rule cache.List
of UserBehaviorRule
objects.public java.util.Map getBehaviorRules()
Map
of rule keys and UserBehaviorRule
objects.public static MarketingEngineCache singleton()
MarketingEngineCache
object.MarketingEngineCache
object to reuse.public static void shutdown()
public static void loadExistingBehaviorRulesAndTriggerListeners(java.lang.Integer activityId) throws DataMediatorException
DM_BHVRLOAD
)
will be invalidated. This will result in removing all the behavior rules from the cache.
Each time the behavior rules need to be checked, the code checks for the existence
of the behavior rule indicator in the cache. If the behavior rule indicator does not
exist, then the behavior rules will be loaded and cached.
If the activity has any associated e-Marketing Spot trigger listeners, then the entries
will be invalidated and removed from the cache. The next time an e-Marketing Spot
is viewed and a trigger listener does not exist in the cache, then the trigger listeners will
loaded and cached.
THIS METHOD IS NO LONGER USED.activityId
- The specific activity for which to load the behavior rules and trigger
listeners into the cache.DataMediatorException
public com.ibm.commerce.marketing.internal.runtime.objects.UserBehavior getUserBehavior(java.lang.String personalizationId, java.lang.Integer storeId)
UserBehavior
object based on the personalizationId
for a customer. If no record is found in the database, then an empty entry is placed into the cache
to indicate that it has checked the database for the user behavior entry. However, this method will
return null when the empty entry is found in the cache.personalizationId
- The unique ID representing the customer.storeId
- The ID of the store.UserBehavior
object associated with a customer.public void setUserBehavior(java.lang.String personalizationId, com.ibm.commerce.marketing.internal.runtime.objects.UserBehavior ub, boolean existing, boolean persistChanges)
UserBehavior
object based on the personalizationId
for a customer in the cache and in the database.personalizationId
- The unique ID representing the customer.ub
- The UserBehavior
object associated with a customer.existing
- This is true if there is already a user behavior entry in the database, otherwise it is false.persistChanges
- This is true if changes need to be persisted in the database. If it is false, then
the changes are only stored in the cache.public void flushUserBehaviorBatchUpdateCache()
public void putRankingStatistic(java.lang.Long objectId, java.lang.String groupId, java.lang.Short objectType, java.lang.Integer storeId, java.lang.Integer elementId, java.lang.Double amount)
userBehaviorBatchUpdateCacheSize
parameter in the wc-admin-component.xml configuration file.objectId
- The unique ID representing the object. For most browsed or most purchased, this is the catalog entry ID.groupId
- The group ID associated with the object. For most browsed or most purchased, this is the category ID.objectType
- The type of the statistic. A value of 0 means purchased, a value of 1 means browsed.storeId
- The store ID.elementId
- The ID of the ranking campaign element.amount
- The amount associated with the statistic.public void flushRankingStatisticsCache()
public java.lang.String getMarketingSpotOrderingInterface(java.lang.Integer storeId, java.lang.Integer emsId, java.lang.String contentType)
storeId
- The ID of the store.emsId
- The ID of the eMarketing spot.contentType
- The type of content to be ordered.public void removeMarketingSpotDefaultContent(java.lang.Integer storeId, java.lang.Integer emsId)
storeId
- The unique identifier of the store.emsId
- The unique identifier of the e-Marketing Spot.public void removeMarketingSpotTitle(java.lang.Integer storeId, java.lang.Integer emsId)
storeId
- The unique identifier of the store.emsId
- The unique identifier of the e-Marketing Spot.public java.util.List getMarketingSpotDefaultContentForSingleStore(java.lang.Integer storeId, java.lang.Integer emsId)
storeId
- The unique identifier of the store.emsId
- The unique identifier of the e-Marketing Spot.EMarketingSpotDataBean
objects of the default data
to display in the e-Marketing Spot.public java.util.List getMarketingSpotDefaultTitleContentForSingleStore(java.lang.Integer storeId, java.lang.Integer emsId)
storeId
- The unique identifier of the store.emsId
- The unique identifier of the e-Marketing Spot.EMarketingSpotDataBean
objects of the default title data
to display in the e-Marketing Spot.public java.util.List getMarketingSpotDefaultContent(java.lang.Integer storeId, java.lang.Integer emsId)
storeId
- The ID of the store.emsId
- The ID of the eMarketing spot.EMarketingSpotDataBean
objects of the default data
to display in the e-Marketing Spot.public java.util.List getMarketingSpotDefaultTitleContent(java.lang.Integer storeId, java.lang.Integer emsId)
storeId
- The ID of the store.emsId
- The ID of the eMarketing spot.EMarketingSpotDataBean
objects of the default title data
to display in the e-Marketing Spot.public java.util.Map getSearchEMarketingSpots(java.lang.Integer storeId)
storeId
- The ID of the store.public CampaignInitiativeCache.CachedEMarketingSpot getEmarketingSpot(java.lang.String name, java.lang.String usage, java.lang.Integer storeId)
name
- The name of the e-Marketing Spot.usage
- The usage type of the e-Marketing Spot.storeId
- The ID of the store in which to find the e-Marketing Spot.public void clearEMarketingSpotFromRegistry(java.lang.String name, java.lang.String usage, java.lang.Integer storeId, java.lang.Integer emsId)
name
- The name of the e-Marketing Spot for which entries should be removed from the cache.usage
- The usage type of the e-Marketing Spot for which entries should be removed from the cache.storeId
- The ID of the store associated with the e-Marketing Spot.emsId
- The ID of the e-Marketing Spot for which entries should be removed from the cache.public static java.lang.Integer getExistingElementUniqueIdFromElementName(java.lang.String elementName, java.lang.Integer activityId)
elementName
- The name of a campaign element.activityId
- The ID of the activity associated with the element.public static java.lang.String getElementUniqueIdFromElementName(java.lang.String elementName, java.lang.Integer activityId)
elementName
- The name of a campaign element.activityId
- The ID of the activity associated with the element.public static java.lang.String getElementUniqueIdFromElementName(java.lang.String elementName, java.lang.String activityName)
elementName
- The name of a campaign element.activityName
- The name of the activity associated with the element.public static boolean isInitialized()
MarketingEngineCache
object has been initialized.MarketingEngineCache
object has been initialized.public static void invalidateBehaviorRulesLoadedIndicator()
DM_BHVRLOAD
entry from the cache to indicate that the behavior rules need to be reloaded.public static void checkBehaviorRulesLoaded(boolean fromSensor)
DM_BHVRLOAD
. If the entry exists
in the cache, then it is assumed that all the behavior rules are loaded into the cache.
If the entry does not exist, then the behavior rules need to be loaded.fromSensor
- This indicates that the sensor event listener has called to get the
behavior rules. In that situation, a service needs to be called in order to load the
behavior rules. Otherwise, it is assumed the code is already
running under a service and the behavior rules can be directly loaded.public static void loadBehaviorRulesByServiceCall()
public java.lang.String getPromotionIdFromName(java.lang.String promoName)
promoName
- The promotion name for which to retrieve the promotion ID.public void setFlowElement(FlowElement entry, Activity activity, com.ibm.commerce.marketing.internal.runtime.objects.ActivityElementData activityElementData)
FlowElement
object.
It parses the flow element XML. For triggers, the type and name value pairs are stored in the
FlowElement
object. For targets and actions, the invocation
parameters are stored in the FlowElement
object.entry
- The FlowElement object for which to update the cache.activity
- The Activity business object.activityElementData
- The element and element nvp data for all the elements in the activity.public static void loadExistingBehaviorRulesAndTriggerListeners(Activity activity, com.ibm.commerce.marketing.internal.runtime.objects.ActivityElementData activityElementData, com.ibm.commerce.marketing.internal.runtime.objects.TriggerListen[] triggerListeners) throws DataMediatorException
DM_BHVRLOAD
)
will be invalidated. This will result in removing all the behavior rules from the cache.
Each time the behavior rules need to be checked, the code checks for the existence
of the behavior rule indicator in the cache. If the behavior rule indicator does not
exist, then the behavior rules will be loaded and cached.
If the activity has any associated e-Marketing Spot trigger listeners, then the entries
will be invalidated and removed from the cache. The next time an e-Marketing Spot
is viewed and a trigger listener does not exist in the cache, then the trigger listeners will
loaded and cached.activity
- The activity object associated with the activity.activityElementData
- The element and element nvp data for all the elements in the activity.triggerListeners
- The array of TriggerListen objects associated with the activity's e-Marketing Spot trigger listeners.DataMediatorException
public void setActivity(com.ibm.commerce.marketing.internal.runtime.objects.ActivityElementData activityElementData, Activity entry, com.ibm.commerce.marketing.internal.runtime.objects.TriggerListen[] triggerListeners)
Activity
object based on an activityId
.
If the activity cannot be found in the cache, it is loaded from the database and placed in the cache.
It parses the flow elements, and stores the ActivityFlowElement
objects in the Activity
object.activityElementData
- The element and element nvp data for all the elements in the activity.entry
- The activity object associated with the activity.triggerListeners
- The array of TriggerListen objects associated with the activity's e-Marketing Spot trigger listeners.public java.util.Map getEmarketingSpotRelatedInfo(java.lang.Integer emsId, java.lang.Integer storeId)
emsId
- The ID of the e-Marketing Spot.storeId
- The ID of the store in which to find the e-Marketing Spot.public static boolean getCurrentFoundationVersionIsFEP6()
public static boolean getCurrentCmcVersionIsFEP6orHigher()