After selecting Configure Allocation Rules on the Delivery Manager Setup menu, scroll to Add Allocation Rules(s).
Each new rule is made up of the following basic components:
The Rule type, which is the first field that needs to be selected and determines what is displayed for the other drop-down menus:
The From date starting from which the rule is to be come into effect (or leave blank for the rule to come into effect immediately).
The To date on which the rule is to cease (or leave blank for the rule to apply indefinitely).
The carrier service to which the rule applies. The default is any service or carrier, but, using the the drop-down menu, you can specify that the rule is to apply to a particular carrier or service, or else to any service in a particular carrier 'service group' (for example, any service in the 48 Hours group).
The warehouse to which the rule applies (the default is any warehouse).
The information in the rule-dependent drop-downs, which is covered below.
These are the most common types of rule, and each one is typically used to exclude a carrier service where a particular condition applies. The components for a weighting rule (over and above the Basic components) are as follows:
Rule type. For any Weighting type rule, you need to specify how it is to be scored. The default Weighting is Exclude, which means that meeting the conditions of the rule will set the carrier service to -1 and thereby exclude the service. However, if the system property
operation.mode.scoringis set to
truefor either the retailer or warehouse, you can set scores that allow the score for a carrier service to be adjusted upwards or downwards from the default baseline of 1.0.
It is vital that the above property is set for custom rules.
operation.mode.scoring.advancedis also set to
truefor either the retailer or warehouse, you can select these scores from the UI, via the drop-down under Exclude:
The closer to zero a score is, the more likely the associated carrier service is to be used for allocation. You can specify your own exact score for a carrier service if you use the Rule Examples Custom rule type.
Except for where a score is -1 (which immediately rules a service out of consideration, and no further processing takes place), scores are cumulative. This means that a delivery option receives an initial score, which can then be added to, subtracted, multiplied and divided, based on each subsequent rule. For example, if a carrier is discouraged from being allocated consignments of a certain weight, and, say, is given a score of 2.0, then the score can be adjusted downwards if the carrier is able to deliver within the next 48 hours (so, the score might come down to 1.1).
The condition that must be met in order for the Scoring type to be applied (for example, Exclude the service if the shipping cost is more than 100). The fields used to define the condition are dependent on the Rule type:
Weighting by <number field> (weights & measures). You select one of the following as the number field:
Maximum parcel value,
Weight of the heaviest parcel,
Maximum parcel dimension, or
Consignment value. Then specify whether the condition for the number field is for it to be
less than, or
equal to, the custom value at the end of the condition (default 100).
Weighting by <text field> (names, addresses & codes). You select one of the following as the text field:
Custom. Then specify whether the condition for the text field is for it to be
not equal to,
end with, or
contain, the custom text string at the end of the condition.
Weighting by <flags> (POD, fragile, etc.). You simply select one of the following as the consignment-level condition that must be met for the Scoring type to be applied:
If any kind of proof of delivery is required.
If the consignment contains fragile items.
If The consignment contains no fragile items.
If the consignment contains hazardous items.
If the consignment contains no hazardous items.
If the consignment contains liquid items.
If the consignment contains no liquid items.
If the consignment is palletised.
If the consignment is not palletised.
If the consignment requires a two-man service.
If the consignment does not require a two-man service.
Weighting by <time of day> (cut-off, collection times). You select one of the following as the time:
Current time at the origin,
Current time at the destination,
Earliest collection time,
Latest collection time,
Earliest delivery time,
Latest delivery time, or
Order cut-off time. Then specify whether the condition for the time is for it to be
equal to, the custom time at the end of the condition.
Weighting by <period of time> (between cut-offs, transit times, earliest collections, etc.). You select one of the following as the period of time:
Time until cut-off,
Time until despatch,
Maximum time in transit,
Time until earliest possible delivery, or
Time until guaranteed delivery. Then specify whether the condition for the period of time is for it to be
less than, or
equal to, the custom number of
calendar days, or
Weighting by <day of the week> (weekdays, weekends, etc.). You select either
delivery day, and then specify that the condition is for it to be on a specified day of the week (Monday to Sunday), at the weekend, or on any weekday.
Weighting by international/domestic or by country. You simply select the consignment destination as the condition that must be met in order for the Scoring type to be applied. This can be a specific individual country or one of the following general geographical areas:
the same country as the country of origin,
a country within the same trading block as the country of origin,
a different country from the country of origin, or
a country outside the trading block of the country of origin.
Engine type factor and basic weighting
This rule type allows you to apply a custom factor (including 0 or -1) to any of the following:
cost per kilo, or
fixed unit. This allows you to increase or decrease the score applied to the associated carrier service. For example, you can apply a factor or 2.0 or 3.0 to make a service less likely to be selected for allocation, in a similar way to the discourage scoring type.
Despatch limits for services <by number>
This rule type allows you to limit the associated carrier service so that either the service itself or the associated carrier can deliver no more than a custom number (default 100) of
kilograms per day.
Custom rule type
(Custom) as the rule type allows you to enter the conditions/tests and scores directly, using our expression language.
Before using custom rule types, it is advisable to use the Export button in the top right hand corner of the Allocation Rules page to export the rules created via the other rule types. When you open the resultant CSV file, you will see that the exported rules contain the test and score expressions that form part of the custom rule syntax. As well as providing a valuable backup, this will help you in writing your own custom rules.
It is beyond the scope of this section to cover the syntax of the expression language, but custom rule examples are provided that should give you an idea of how to start creating your own rules.
The final step in creating your rule
After you have created a rule, don't forget to click Add rule(s) at the bottom of the Add Allocation Rule(s) dialog. This saves the rule at the top of the Allocation Rules page.