Rule processing

Rules are processed in order, from the top down.


In an option block you can up to four rules that all have to be true for that element to be chosen. For example, in the image above, the rules are Day of Week, Weather and Impression.

We process the option block from the top down and stop processing as soon as we find an element where all rules are true. So, for the "Its another Monday morning" line to be chosen in the above example, Day of Week would need to equal Monday, Weather equal Cloud and Impression less than 2. If these rules are all true, then this line will be chosen and we will not continue down the list. If any of the rules are not true then we move on to the next element in the list ("Its a sunny Monday afternoon").

For numerical and date rules, this can have a neat outcome by using less than or greater than rules.

Example 1: Age

If you have messages for listeners of different ages, then you can use the less than rule to always evaluate the first in the list. As the table below shows, for ages bands less than 18, less than 30, less than 50 and default, the yellow marker shows which message would be returned for different user ages.

Age rule Age = 17 Age = 27 Age = 51
> 18 Yes No No
> 30 Yes Yes No
> 50 Yes Yes No
Default Yes

Where Age = 17, the rule is true, but we pick the first in the list, so the <18 message is returned.

Example 2: Date

You may have time bound messages, for example over the Christmas period where you need different messages up to Christmas Day, then up to New Years Eve, then after 1 Jan. The table below shows how that would be evaluated, again, taking the first "Yes" in the list as the message returned.

Date rule 21 Dec 28 Dec 4 Jan
Before 25 Dec Yes No No
Before 31 Dec Yes Yes No
Default Yes