CPN Generation Scheme
Overview
The Component Part Number (CPN) schema configuration system allows you to define structured rules for generating and validating part numbers in your PLM library. Using YAML configuration files, you can specify patterns, constraints, and validation rules that ensure consistency across your organization's component numbering system.
Schema Structure
A CPN schema configuration consists of three main sections:
Version and Type Information
Global Settings
Element Definitions
Examples
Basic Structure
Global Settings
The settings
section controls global behavior of your CPN scheme:
allow_override
boolean
Enables/disables manual CPN override capability
allow_freeform
boolean
Enables/disables support for freeform CPNs that don't follow the scheme
case_sensitive
boolean
Determines if CPNs should be treated as case-sensitive
Element Types
The elements
section defines the components that make up your CPN. Each element represents a segment of the CPN and can be one of the following types:
List Element
Used for predefined sets of values, such as categories or families.
List elements can also reference external value sets using the template syntax:
Constant Element
Defines a fixed value, typically used for separators or prefixes.
Numeric Counter
Generates sequential numbers within a specified range.
Hex Counter
Similar to numeric counter but generates hexadecimal values.
Group Element
Combines multiple elements into a logical group, useful for optional sections.
Example Configurations
Basic CPN Scheme
This example shows a simple category-based numbering scheme:
This scheme generates CPNs like 410-0001
, where:
410
is the category code-
is a constant separator0001
is a sequential number
Advanced Two-Variable Scheme
Here's a more complex scheme with multiple variables and an optional suffix (for something like a variant):
This scheme generates CPNs like DOGS-410-0001
or CATS-591-0042.test
, where:
First segment is a family code
Second segment is a category code
Third segment is a sequence number
Optional suffix after a dot for variants
Best Practices
Start Simple: Begin with a basic scheme and add complexity as needed.
Use Clear Names: Choose descriptive names for elements to make the configuration self-documenting.
Validate Patterns: Always include regex patterns for list values to ensure consistency.
Include Examples: Provide comprehensive examples that cover all possible variations of your scheme.
Consider Scale: Set appropriate ranges for counters based on expected volume.
Document Meanings: Include descriptions for list values to make their purpose clear.
Common Patterns
Category-Based Numbering
Family/Category Hierarchy
Optional Variants
Validation Rules
List values can have additional regex validation patterns
Free text elements must specify max length and allowed patterns
Counter ranges must be appropriate for their use case
All required elements must be included in the sequence
Group elements can contain their own validation rules
Troubleshooting
Common issues and their solutions:
Invalid Patterns: Ensure regex patterns are properly escaped in YAML
Counter Overflow: Check that counter ranges are sufficient for your needs
Missing Required Elements: Verify all required elements are included
Case Sensitivity: Consider implications of case-sensitive settings
Validation Conflicts: Ensure patterns don't conflict with other rules
Reference
Last updated