Rules and Rulebooks > Rules and Rulebooks > Importance of Rulebooks
  
Importance of Rulebooks
You can generate a large amount of the data on a shipment through the use of rulebooks and—when interfacing from an ERP system to PRECISION—from information on the sales order. You or your colleagues can enter the remaining information such as container numbers and despatch dates manually.
Rulebooks allow you to set up details regarding the movement of goods in advance of shipping. You can set up rulebooks by country, consignor, customer, consignee, and product.
Example: A rulebook contains one rule for shipments when the Transport mode field is set to Sea and another rule for shipments when the Transport mode field is set to Air. When shipping using multiple transport modes, the appropriate rule fires based on the transport mode that exists on the shipment.
Preloaded Rules and Rulebooks
To simplify and speed up the setup of rulebooks, PRECISION contains the following preloaded rules and rulebooks:
A preloaded rule and rulebook for each country. The format of the rule and rulebook name is QCTRY-<COUNTRY_CODE>, where <COUNTRY_CODE> is the two-digit ISO country code for that country, for example, QCTRY-IN is the country rule for India. Preloaded rules and rulebooks speed up the creation of rule determinations.
PRECISION also contains the PEM-RB rulebook, which contains the PEM-IN, PEM-OUT, and PEM-TRACER rules for attaching shipping plans to shipments.
Attaching Rulebooks to Shipments
You can attach rulebooks to a shipment in a number of ways:
Using the DEFAULT RULE BOOKS system value. For more information on this system value, see System Values for Rules and Rulebooks.
By country, using the Country Rule Books sub-option in the CT option or the Country tab in the <ASSOCIATION> for Rulebook <RULEBOOK_NAME> grid of the RULES screen.
By consignor, using the Partner tab in the <ASSOCIATION> for Rulebook <RULEBOOK_NAME> grid of the RULES screen.
By product, using the Associated Rule Books sub-option in the PR option or the Product tab in the <ASSOCIATION> for Rulebook <RULEBOOK_NAME> grid of the RULES screen.
By customer, using the Partner tab in the <ASSOCIATION> for Rulebook <RULEBOOK_NAME> grid of the RULES screen.
By consignee, using the Partner tab in the <ASSOCIATION> for Rulebook <RULEBOOK_NAME> grid of the RULES screen.
Rule Hierarchy
The rule hierarchy determines the order in which rules apply to shipments. Therefore, rules lower in the hierarchy can override higher rules. The lower the level in the hierarchy, the more specific the rule.

Rule Hierarchy
 
Position
Method
1
System values
2
Consignee inherited partner country
3
Consignee inherited partner country + shipment type
4
Consignee country
5
Consignee country + shipment type
6
Consignor
7
Consignor + shipment type
8
Product
9
Product + shipment type
10
Customer
11
Customer + shipment type
12
Consignee inherited partner
13
Consignee inherited partner + shipment type
14
Consignee
15
Consignee + shipment type
Example: A rule at country level populates the carrier and a rule at customer level populates the carrier; the shipment contains the carrier applied in the customer rule.
Important: If a document is added to a shipment in more than one rule, then the document only contains details from the document set up on the last rule to fire; it does not merge the notes from each occurrence of the document in the rule hierarchy. A document is only attached to a shipment when the document criteria parameters of transport mode, print stage, declaration, currency, delivery term, and value are met.
When processing rulebooks within rulebooks, PRECISION fires the rule at the bottom first and works back up through the nested rules.
You can use the Assigned Rules Web UI Workflow task, SHSU, to see a list of the rulebooks and rules fired against a shipment. If a rule fires against a shipment more than once, the rule appears in the list more than once.
Rules Processing in the Shipment Life Cycle
Typically, rules processing begins when a shipment is created, either manually or through an interface with an ERP system.
However, it is possible to fire rules at different stages of the shipment life cycle, by grouping rules in rule sets representing life cycle stages, and using the rule set as the basis for rule determination.
This document describes rules processing that begins at the start of the shipment life cycle.
Shipment Creation and Rules Processing Performance
Rules processing can increase the time that it takes to create a shipment transaction in PRECISION. There are a number of configuration options available to mitigate this issue.
The rule logic is transaction driven, which means that it first looks at the shipment items or shipment partners, then finds the product or partner master records, and then checks the rule information. If you are certain that there are no rules assigned based on a particular characteristic of the shipment such as the products in the item lines or the consignee, then turning these checks off can reduce rules processing time and speed shipment creation up.
Example: You know that there are no rules configured at a product level, so you set the APPLY PRODUCT RULES system value to No. When rules processing runs, it skips the step that finds all products on the shipment line items and checks for associated rules.
System values that can reduce rules processing time include APPLY CONSIGNEE RULES, APPLY CONSIGNOR RULES, APPLY CUSTOMER RULES, APPLY PRODUCT RULES, and APPLY EXPORT REFUND RULES. For an explanation of these rules, see System Values for Rules and Rulebooks.