Example: campaign element template for a trigger

When you create a custom trigger for a marketing activity, you can refer to this sample when you create the trigger's campaign element template.

Sample

Here is the SQL statement to add the campaign element template code for an example trigger to the DMELETEMPLATE table. In this example, an external system detects credit fraud. The external system can detect credit card fraud, or credit account fraud. The external system sends a message to the marketing runtime that one of these occurrences of fraud occurred for a customer. Using this customized trigger, a Marketing Manager would be able to create a Dialog activity to specify how to follow up with the customer in this situation (for example, send a mobile text message or an email, depending on their level of coverage, and then send a follow-up message after a certain time).

This campaign element template has an implementation definition and a behavior rule definition.

insert into dmeletemplate (dmeletemplate_id, dmelementtype_id, name, implxml, behaviorxml) 
values 
(1003, 1, 'Custom Fraud Detected Trigger',
'<Trigger type="customFraudDetectedTrigger">
<Implementation invocationType="TaskCommand">
<Class name="com.mycompany.CustomFraudDetectedTriggerTaskCmd">
</Class>
</Implementation>
</Trigger>',  
'<BehaviorRule 
command="CustomFraudDetectedTriggerEvent" 
action="send" 
comparison="=">
<Variable 
name="eventType" 
value="MARKETING_eventType" 
type="NVP"/>
</BehaviorRule>');