Implementation definition: for triggers
The implementation definition is an XML fragment in a campaign element template definition. All triggers must have an implementation definition.
- Specify the unique name of the trigger's campaign element template.
- Specify any parameters that business users can enter in the user interface for the trigger. See Campaign element template parameters.
- Specify the task command associated with the trigger, if the trigger has a task command. See Campaign element task commands.
Triggers must have a task command if either of the following is true:
- The trigger is a daily check trigger, rather than a customer event trigger. See Types of Dialog activity triggers and when they are processed.
- The user interface for the trigger requires validation when the business user activates the activity containing the trigger.
Where implementation definitions are stored
Table: DMELETEMPLATEColumn: IMPLXML
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
- This is the unique name for this trigger's campaign element template.
- callCmdOnMatch
- Optional: If you require additional processing when a customer reaches a trigger element in an activity, then specify the callCmdOnMatch parameter. This parameter calls the performExecute method on the specified task command. The command referenced in this parameter must implement the MarketingCampaignElementTaskCmd method to call the performExecute method. Note that in most cases this function is not required. None of the triggers shipped with Management Center 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
- This is the name of the parameter that must be passed to the task command for processing.
- value
- This is 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 theMARKETING_
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. This must be a class that implements the MarketingCampaignElementTaskCmd interface:
- name
- This is 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. Here is an example:
com.your_company_name.marketing.commands.elements.CustomFraudDetectedTriggerTaskCmd
Examples
Here is an example of an implementation definition XML for a trigger. This example is for the Customer Registers trigger shipped with Management Center. This trigger does not have a task command or parameters, so the implementation definition specifies only the unique name for the trigger's campaign element template:
<Trigger type="Registers">
</Trigger>
This example is for the Customer Celebrates Birthday trigger shipped with Management Center. This trigger implementation definition has two parameters. It also requires a task command because it is a daily check trigger and it has user interface parameters to validate:
<Trigger type = "birthdayTrigger">
<Parameter name = "numberOfDays" value = "MARKETING_numberOfDays"/>
<Parameter name = "repeatSchedule" value = "MARKETING_repeatSchedule"/>
<Implementation invocationType = "TaskCommand">
<Class name = "com.ibm.commerce.marketing.commands.elements.BirthdayTriggerTaskCmd"/>
</Implementation>
</Trigger>