Sometimes, when configuring a routing rule, it may be necessary to share traffic between several routes for one of the common reasons below:
- distribute the load between several vendors or between several products of the same vendor;
- keep vendor statistics up-to-date, constantly updating them by sending a small portion of traffic.
In the first case, in order to distribute the load between several routes the Share parameter is used. This parameter is available when 2 or more sub-choices are created within one choice. It specifies how traffic should be divided between the sub-choices. For example, if the first sub-choice is "A" product with the share 10%, the second is "B" product with the share 70% and the third is "C" product with the share 20% (total sum of the shares should be 100%), then every time when the rule is selected for routing, a random number (from 0 to 1 with floating point) will be generated. If it is equal to or less than the first choice share (0.1), the product X - Wholesale will be used for routing. If the random value is greater than the first share (let’s say it is 0.85), it will be compared with the second share with the following logic: if (random value minus the first share value) <= the second share. So we get (0.85-0.1 = 0.75) > 0.7, that is why the second sub-choice is not selected as well as the first one. The logic for application of the next sub-choice is the same: 0.75-0.7 = 0.05 < 0.2 which met the condition - so the "C" product will be added to the routing list.
Note that only one sub-choice out of all specified in the choice is always added to the routing, for example, in the screenshot below, the maximum total number of routes will be two, only one first vendor from the first choice will be chosen.
Also note, that in case of rerouting, the traffic cannot be rerouted between vendors A/B/C for the same reason: they are present in the same choice; and if there are no more choices of any other rules configured and the vendor chosen according to the share parameter replies unsuccessfulle, then the message will receive ROUTE FAILED status, for example, in this case:
Thus, since the routing modules do not track the percentage of traffic already sent toward vendors within a share-based rule, therefore the result may seem not that totally accurate. The more traffic goes through the rule, the more accurate are the share results.
As for the task of keeping vendor statistics up-to-date, there are two options:
- the Test share, % parameter
- test rules with the Probability parameter
The Test share, % parameter can be used to define the share of traffic passing through the rule that needs to be divided between all vendors present in the Vendor products list of a dynamic formula-based choice in order to keep their stats up-to-date. For example, if you set it as 5, then in 5% of routing cases, vendors from the Vendor products list are sorted by the RND formula, the Formula field will be ignored. However, the Condition which is checked before the Formula must still be TRUE for all of those vendors in order for them to be accepted for routing.
The task of updating statistics on vendors can be solved using a separate type of routing rules called Test Rules (Instead of Regular Routing):
The only difference between Test rules is the Probability parameter at the bottom of the rule: the rule works like a standard routing rule, but is "present" in routing only in a certain percentage of requests indicated in the Probability parameter (for the rest cases the routing goes as if there is no such rule). You can create a Test rule with a high Priority, put vendors with insufficient statistics and give them a chance to update the stats, for example:
If you have any remaining questions, feel free to contact the support team and provide as much detail as possible regarding your issue, including Routing rule ID and Simulation ID.
AKBSMS - Alaris Knowledge Base
Sharing traffic between several vendors.
Updating vendor statistics.
Keeping vendor statistics up-to-date.
Test share.
Probability.
Test routing rules.
Distributing the load between vendors.
Link to this Article: https://helpdesk.alarislabs.com/en/knowledge_base/article/279/category/134/