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 given trigger, the process works like this: when the event associated with the behavior rule definition is detected, then the occurrence of that event is recorded. The recorded behavior is also evaluated against the related rule definition. If the customer's recorded behavior meets the criteria in the related rule definition, then the trigger will occur.

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 if the customer has now participated 10 times. If the customer has, then the trigger will occur.

Where related rule definitions are stored

Table: DMELETEMPLATE

Column: RELATEDXML

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 shipped with the Management Center. 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 fragments in the example are:
  • 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"
      comparison = "recordAll"
      maxSize = "MARKETING_numberOfTimes"
      maxTotalSize = "MARKETING_numberOfTimes"
      relativeDays = "MARKETING_daysOperator">
      <Variable
          name = "type"
          value = "*"
          type = "NVP"/>
      <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 = "*"/>
              <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>