Core Concepts of Duplex Sync Rule Definitions
Understanding Duplex Sync Rule Structureโ
A Duplex Sync validation rule is composed of several key components that work together to create a complete validation check. Understanding these is essential for writing clear and effective rules.
Fundamental Components of a Duplex Sync Ruleโ
Each Duplex Sync rule definition contains the following elements:
- Rule ID: A unique identifier for the rule (e.g., "200.010", "G23", "SYS01").
- Rule Definition: The technical description of the validation logic.
- Error Message: The user-friendly message displayed when the rule is violated.
- Metadata: Additional information such as target markets, sectors, error levels, GPC selections etc. This is not the scope of this document, but it is important to note that metadata can provide context for the rule's application and relevance.
Rule Types and Classificationsโ
Duplex Sync rules can be classified based on their validation logic:
Conditional Rulesโ
Conditional rules use "IF-THEN" logic. The validation is only triggered when a specific condition is met.
Format:
IF [condition] THEN [requirement]
Example:
โ IF 'isTradeItemAConsumerUnit' (3066) equals 'true', THEN 'regulatedProductName' (3314) with languageCode 'da' SHALL be provided.
Mandatory Rulesโ
Mandatory rules define requirements that must always be met.
Format:
[Attribute/Entity] SHALL [requirement]
Example:
โ 'minimumTradeItemLifespanFromTimeOfArrival' (3479) SHALL be indicated on the smallest unit in the hierarchy.
Constraint Rulesโ
Constraint rules define limitations on values.
Format:
[Attribute/Entity] SHALL NOT [constraint]
Example:
โ GTIN SHALL not start with '0579'.
Relationship Rulesโ
Relationship rules define requirements between related attributes.
Format:
IF [attribute1] = [value] THEN [attribute2] SHALL [requirement]
Example:
โ IF 'feedType' (4009) is NOT 'FEED_MATERIALS', THEN 'minimumTradeItemLifespanFromTimeOfArrival' (3479) SHALL be used.
Rule Scope and Contextโ
Hierarchical Scopeโ
Rules can apply to specific levels in the product hierarchy.
Examples:
-
On every level:
โ 'isPackagingMarkedReturnable' (1833) SHALL be indicated on every hierarchy level.
-
On a specific level:
โ 'isBasePriceDeclarationRelevant' (2955) SHALL be indicated on the smallest unit within the packaging hierarchy.
-
Referencing other levels:
โ If TradeItemUnitDescriptorCode (3074) is equal to PALLET, THEN in child trade item the attribute platformTypeCode (1724) SHALL NOT equal '98
GPC-Based Rulesโ
Many rules are contingent on the GPC (Global Product Classification) brick or segment code.
Example:
โ IF targetMarketCountryCode equals '528' (Netherlands), THEN gpcCategoryCode (3122) SHALL NOT be in GPC Segment '94000000'