Implementation definition for targets and actions

The implementation definition is an XML fragment in a campaign element template definition. All targets and actions must have an implementation definition.

The implementation definition XML segment defines the following information for a target or action:
  • The unique name of the campaign element template for the target or action.
  • The task command associated with the target or action. For more information, see Campaign element task commands.
  • The campaign element template parameters to pass to the task command. For more information, see Campaign element template parameters.
    • For a target, the parameters that define the criteria for the target. For example, a target can require a customer to belong to the Preferred Customer customer segment. If the customer matches the criteria for the target, the task command returns true.
    • For an action, the parameters that define the action, such as an action to send the customer an email or display content in an e-Marketing Spot.

Where implementation definitions are stored

Format of implementation definitions

Implementation definitions use the following format:


<FlowElementImplementation type="UNIQUE_NAME">
 <Implementation invocationType="TaskCommand">
  <Class name="TASK_COMMAND_CLASS_NAME">
   <Argument name="paramName1" value="MARKETING_paramName1"/>
   <Argument name="paramName2" value="paramValue2"/>
  </Class>
 </Implementation>
</FlowElementImplementation>

Parameters in implementation definitions

Each parameter that an implementation definition can contain, as shown in the previous format example, is described here:

type
The unique name of the campaign element template for this target or action.
invocationType
This value is always TaskCommand.

For the <Class> element: Each target and action has an associated task command. This value must be a class that implements the MarketingCampaignElementTaskCmd interface.

name
The name of the campaign element task command class for this campaign element. If you are creating a new target or action, the value that you specify must match the name of the custom task command that you create to support the new campaign element. For example:
com.your_company_name.marketing.commands.elements.CustomLevelOfSupportTargetTaskCmd

For the <Argument> element: The implementation definition XML can have zero or more of these campaign element template parameters. When a customer reaches a target or action element in a marketing activity, the marketing services pass the parameters to the campaign element task command. The task command retrieves the parameters by using the getElementParameters method and then uses the parameters to evaluate the target or perform the action.

name
The name of the parameter that must be passed to the task command for processing so that the target or action can do its work.
value
The value of the parameter. If the parameter value is coming from the user interface, then the value must be in the format MARKETING_paramName. If the parameter value is coming from somewhere other than the user interface, then the value does not need the MARKETING_ prefix.

Examples

The following code snippets show example XML fragments for implementation definitions:
  • Example XML fragment for an action that displays a category recommendation within an e-Marketing Spot on a store page.
    
    <FlowElementImplementation type="Category">
        <Implementation invocationType="TaskCommand">
            <Class name="com.ibm.commerce.marketing.commands.elements.DisplayCategoryActionTaskCmd">
                <Argument name="categoryIdList" value="MARKETING_categoryIdList"/>
            </Class>
        </Implementation>
    </FlowElementImplementation>
  • Example XML fragment for a target that checks whether a customer is in a customer segment.
    
    <FlowElementImplementation type="Customer Segment">
        <Implementation invocationType="TaskCommand">
            <Class name="com.ibm.commerce.marketing.commands.elements.CustomerSegmentTargetTaskCmd">
                <Argument name="segmentIdList" value="MARKETING_segmentIdList"/>
                <Argument name="anyOrAll" value="MARKETING_anyOrAll"/>
                <Argument name="containsOperator" value="MARKETING_containsOperator"/>
            </Class>
        </Implementation>
    </FlowElementImplementation>