Contextual Rule Component
A Contextual Rule component is used to configure a custom rule that can be applied in a particular context dictated by the Gear component. For example, you can create a rule that filters out promotions in a Contextual Bandit campaign based on whether a user has an attribute that matches the eligible promotion's related catalog object. These filtering rules can be checked when applied to any campaign, bandit arm, or segment. If a rule is not applicable for a particular environment, the filter is not applied.
The following table describes the available methods and implementations for the Contextual Rule component.
|The type of data the Gear component uses to identify whether to apply this filter. Examples include |
|A method that returns the value the rule needs to calculate whether it matches. The return type must correspond to the type declared as the |
|A method returning a boolean, which is the actual logic for the rule.|
|A method returning |
|A method returning a string that summarizes the rule (for the UI).|
|A method returning a string corresponding to a very brief (one or two word) summary of the rule to appear in the template editor UI.|
|An optional method to return a font awesome icon that appears in the UI.|
The following is an example of a Contextual Rule configuration.