Implementation definition for triggers

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

The implementation definition XML fragment defines the following information for a trigger:
  • The unique name of the campaign element template for the trigger.
  • The parameters that business users can enter in the Management Center for the trigger. For more information, see Campaign element template parameters.
  • The task command that is associated with the trigger, if the trigger has a task command. Triggers must have a task command if either of the following statements is true:
    • The trigger is a daily check trigger, rather than a customer event trigger.
    • The user interface for the trigger requires validation when the business user activates the activity that contains the trigger.
    For more information, see Campaign element task commands.

Where implementation definitions are stored

Format of trigger implementation definitions

Implementation definitions use the following format:


<Trigger type="UNIQUE_TRIGGER_NAME" callCmdOnMatch="COMMAND_INTERFACE_NAME">
 <Parameter name="parameter1" value="MARKETING_paramName"/>
 <Parameter name="parameter2" value="parameter2Value"/>
 <Implementation invocationType="TaskCommand">
  <Class name="TASK_COMMAND_CLASS_NAME"/>
 </Implementation>
</Trigger> 

Parameters in trigger implementation definitions

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

type
Tthe unique name for this trigger's campaign element template.
callCmdOnMatch
Optional: If you require more processing when a customer reaches a trigger element in an activity, specify the callCmdOnMatch parameter. This parameter calls the performExecute method on the specified task command. The command that is referenced in this parameter must implement the MarketingCampaignElementTaskCmd method to call the performExecute method. In most cases, this function is not required. None of the triggers that are provided by default specify this parameter.

For the <Parameter> element, the implementation definition XML for a trigger can have zero or more of these campaign element template parameters. The parameters identify the data business users can enter in the user interface for the trigger.

name
The name of the parameter that must be passed to the task command for processing.
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.

For the <Implementation> element:

invocationType
This value is always TaskCommand.

For the <Class> element, specify the associated task command for the trigger, if the trigger has one. The task command must be a class that implements the MarketingCampaignElementTaskCmd interface:

name
The name of the campaign element task command class for this trigger. If you are creating a new trigger, then whatever name you specify here must match the name of the custom task command you create to support the new trigger. For example:
com.your_company_name.marketing.commands.elements.CustomFraudDetectedTriggerTaskCmd

Examples

The following code snippets show example XML fragments for implementation definitions of triggers:
  • Example XML fragment for the Customer Registers trigger, which is provided by default within the Marketing tool. This trigger does not have a task command or parameters, so the implementation definition specifies only the unique name for the trigger campaign element template.
    
    <Trigger type="Registers">
    </Trigger>
    
  • Example XML fragment for the Customer Celebrates Birthday trigger which is provided by default within the Marketing tool. This trigger implementation definition has two parameters. The definition also requires a task command because the trigger is a daily check trigger and has user interface parameters that require validation.
    
    <Trigger type = "birthdayTrigger">
     <Parameter name = "repeatSchedule" value = "MARKETING_repeatSchedule"/>
     <Parameter name = "numberOfDays" value = "MARKETING_numberOfDays"/>
     <Implementation invocationType = "TaskCommand">
      <Class name = "com.ibm.commerce.marketing.commands.elements.BirthdayTriggerTaskCmd"/>
     </Implementation>
    </Trigger>