Rule XML Objects

Narrow Rule Object

This object defines the Narrow Rule Parameter supplied to the Landing Page methods. The narrow rule is used to specify conditions for selecting results on the landing pages.

 

Please note that Rule object is recursive and it contains other Rule objects inside.

public class Rule { public List<Rule> Rules { get; set; } public RuleOperatorEnum Operator { get; set; } public RuleTypeEnum RuleType { get; set; } public string Field { get; set; } public string Condition { get; set; } public string Value { get; set; } }
public enum RuleTypeEnum { Group, Eval }
public enum RuleOperatorEnum { All, Any, None }

 

Rule XML Representation Example

If the condition set for the rules for selecting products is not linear and requires multiple clauses which cannot be accommodated by the attribute_name or the attribute_value structure, please specify the entire xml for the rule as shown below.

 

Rules node


Attributes:

  • RuleType attribute specifies if the rule must be processed for a result or treated as a group with rules nested inside it. If the rules node contains further rules, then the type must be set to “Group” for that rules node. For rules that need to be evaluated, please set this attribute to “Eval.”

  • Operator attribute specifies what the condition is for evaluation for rules with in a group. If all rules in the group need to be met to satisfy the group the value must be set to “All”. If at least one rule needs to be satisfied, please set the value to “Any”. For nested rules (not the parent rules node), if there is only one rule inside the group please set value to “None”.


Child Nodes:

  • Field: Specify the field name you want to use as part of condition

  • Condition: Specify the condition (is equal to, contains) so on

  • Value: This is the value to compare against