Rule Evaluation Logic Deep-dive

A detailed explanation of how rule evaluation works

Rules Evaluation Logic Flow

Background

This section goes into more detail on exactly how the Village evaluates when a rule should be triggered, and what action to take. It is not required reading, but gives a more in depth understanding of the underlying system.

The Village system relies on two main pillars of data:

  1. Who people are: This involves user data, such as customer or supplier information, and the user's segment memberships and award balances.

  2. What people do: This refers to a user's ongoing activities online and in the real world, including deliveries, clicks, money transfers, and more. Activities fall into two broad categories: "Actions" and "Sales."

When is a rule executed?

Rule evaluation, that is whether a rule should be executed or not, can be triggered in two ways:

  1. User activity: Any real-world or app-based user action, like onboarding, completing a transaction, or making a delivery, can trigger a rule.

  2. Scheduled evaluation: Some rules have specified evaluation frequencies, and they are evaluated at the scheduled dates and times, for example "daily at 9pm GMT.”

Activity-Based Rules

1. Determine Rules to Evaluate:

  • If activity occurs, but there is no trigger set up that is associated with that activity, no rule evaluation commences.

  • When activity corresponds with a trigger, the user activity data will be used to evaluate any relevant rules. This could include a simple rule that is using this particular activity as a trigger, or a more complex cumulative activity goal that uses this trigger within its goal evaluation logic.

  • If the activity does not successfully pass evaluation for any rule or qualify for any goal that triggers a rule, the rule evaluation ends.

2. Rule Conditions and Goal Qualifications

a. Evaluate Rule Conditions:

  • Any rule conditions must be met before executing rule logic.

  • This includes checking whether the activity is within the active dates for both the rule and the program, and that the activity itself occurred within any activity qualification period, if set. If not, the rule evaluation ends.

  • Next, we evaluate whether the award recipient passed segment eligibility criteria at both the rule and program level. If not, the rule evaluation ends.

b. In the case of Goal-based Triggers, Evaluate Goal Qualifications. If not, skip to 3.

  • If the rule trigger passes all rule conditions, the rule's goal qualification logic will be executed.

  • This includes checking whether the activity amount meets the goal qualification requirements and has occurred within the goal qualifying dates. If not, the rule evaluation ends.

3. Rule Execution

a. Execute Rule:

  • If the award is over a max payout threshold, the rule execution ends.

  • If the rule's goal qualifications are met, the rule logic will be executed, which may involve issuing an award, adding or removing a user from a segment, or sending a communication, depending on the rule configuration.

b. Award Calculation:

  • If an award is to be issued, the activity amount is multiplied by the rule award amount to determine the award amount to be applied.

  • If the recipient is on a segment suspension list, the award is not issued, and the rule execution ends.

c. Issue Award or Segment:

  • The award or segment is issued to (or revoked from) the recipient.

Scheduled Evaluation Rules

  • Some rules are evaluated on a schedule rather than as a result of user activity.

  • Scheduled evaluations are used for:

    • Percentile activity goals (eg. is a user in the top 5% of riders based on trip count)

    • Minimum award goals (eg. does a user have 10,000 reward points)

    • Percentile award goals (eg. is a user in the top 5% of users ranked by award points held)

    • When the rule's scheduled evaluation date-time occurs, evaluation will commence. This can lead to the execution of minimum award, percentile award and percentile action goals.

Otherwise, scheduled evaluation rules are evaluated and executed in the same way as activity-based rules.

In all cases, if conditions or qualifications are not met, the rule evaluation or execution ends, ensuring that awards and segments are only issued when all necessary conditions are met.

Last updated