Related rule definition

The related rule definition is an optional XML fragment in a campaign element template definition. Related rule definitions apply only to triggers and they are required only in the following situation: the trigger requires an event to occur multiple times before its criteria is met. For this reason, the trigger's template definition requires a related rule definition that functions like a target, in addition to a behavior rule definition.

For a trigger, when the event that is associated with the behavior rule definition is detected, the occurrence of that event is recorded. The recorded behavior is also evaluated against the related rule definition. If the customer recorded behavior meets the criteria in the related rule definition, then the trigger occurs.

For example, the Customer Participates in Social Commerce trigger has a campaign element template definition that includes a related rule definition. If a business user specifies that the trigger waits until a customer participates 10 times, then each time a customer participates, that event is recorded. In addition, the related rule definition is checked to see whether the customer participated 10 times. If the customer has, then the trigger occurs.

Where related rule definitions are stored

Format of related rule definitions

The related rule definition uses the same format as the implementation definition XML for a target.

Parameters in related rule definitions

The related rule definition has the same parameters as the implementation definition XML for a target.

Examples

The following XML is the full campaign element template definition for the Customer Participates in Social Commerce trigger that is provided by default. By reviewing the full template definition, you can examine how the related rule XML is formed in relation to the behavior rule XML. The XML example includes the following XML fragments:
  • 1: Implementation definition XML
  • 2: Behavior rule definition XML
  • 3: Related rule definition XML

1<Trigger type = "SocialCommerceInteractionTrigger">
    <Implementation invocationType = "TaskCommand">
     <Class name = "com.ibm.commerce.marketing.commands.elements.CustomerParticipatesInSocialCommerceTriggerTaskCmd"></Class>
    </Implementation>
   </Trigger>

2<BehaviorRule 
     command = "SocialCommerceInteraction"
     action = "record"
     maxSize = "MARKETING_numberOfTimes"
     relativeDays = "MARKETING_daysOperator">
     <Variable
      name = "type"
      value = "MARKETING_socialActivityType"
      type = "NVP"
      comparison="MARKETING_comparison"/>
     <Variable
      name = "MARKETING_beforeAfterOnDate"
      value = "MARKETING_date1"
      type = "CURRENTDATE"/>
     <Variable
      name = "MARKETING_beforeDate"
      value = "MARKETING_date2"
      type = "CURRENTDATE"/>
    </BehaviorRule>

3 <FlowElementImplementation type = "Social Commerce Participation">
    <Implementation invocationType = "TaskCommand">
          <Class name = "com.ibm.commerce.marketing.commands.elements.CustomerFilterUserBehaviorTargetTaskCmd">
              <Argument name = "anyOrAll" value = "any"/>
              <Argument name = "containsOperator" value = "="/>
              <Argument name = "dataList" value = "MARKETING_socialActivityType"/>
              <Argument name = "numberOfTimesOperator" value = ">="/>
              <Argument name = "numberOfTimes" value = "MARKETING_numberOfTimes"/>
              <Argument name = "daysOperator" value = "MARKETING_daysOperator"/>
              <Argument name = "daysValue" value = "MARKETING_days"/>
              <Argument name = "matchLocations" value = "history"/>
          </Class>
      </Implementation>
  </FlowElementImplementation>