PIM - Operational Workflows & State Machines
Product lifecycle state machines, variant matrix generation pipelines, channel publication workflows, and complete state transition matrices for the PIM domain.
Operational Workflows & State Machines
Catalog operations involve diverse cross-functional teams: copywriters write localized marketing copy, photographers upload visual assets, packaging engineers define volumetric dimensions, and catalog managers sign off on channel readiness.
To maintain strict operational predictability and data integrity across these parallel efforts, the PIM domain relies on explicit Finite State Machines (FSM) and structured operational workflows. These state machines ensure that catalog aggregates transition through validated states, enforce business invariants at each gate, and broadcast immutable domain events to downstream enterprise systems.
1. Product Lifecycle State Machine
Every product progresses through a deterministic lifecycle from initial creative conception to terminal archival:
flowchart TD
Draft["1. Draft<br/>Initial Product Shell Created"] -->|Begin Enrichment| Enrichment["2. In Enrichment<br/>Attributes, Media & Variants Added"]
Enrichment -->|Submit for Review| Review["3. In Review<br/>Quality & Completeness Audit"]
Review -->|Changes Requested| Enrichment
Review -->|"Approve (100% Gate Passed)"| Published["4. Published / Active<br/>Syndicated to Channels & Downstream"]
Published -->|Quality Breach / Recall| Suspended["Emergency Suspended<br/>Immediate De-publication"]
Suspended -->|Defect Resolved| Published
Published -->|Commercial Sunset Notice| Deprecated["5. Deprecated / Sell-Down<br/>Orders Allowed, Reordering Blocked"]
Deprecated -->|"Stock == 0 & Open Orders Fulfilled"| Archived["6. Archived<br/>Permanent Read-Only Record"]
Stage Definitions & Operational Governance
| Lifecycle Stage | What Occurs at this Stage | Permitted Business Actions | Entry Gate Criteria | Exit Gate Criteria |
|---|---|---|---|---|
| Draft | Conceptual shell initialized. | Define brand, assign handle, bind Attribute Family template. | Product manager creates a new catalog item. | Mandatory identifying fields and family binding confirmed. |
| In Enrichment | Cross-functional content authoring. | Populate custom attributes, upload media, provide translations, generate variant matrix. | Merchandising team accepts item for enrichment. | All mandatory family attributes and variant options populated. |
| In Review | Formal quality and compliance inspection. | Read-only verification; inspect optical barcodes, dimensions, and regulatory labels. | Editor submits product for approval. | Reviewer approves checklist or rejects with actionable failure notes. |
| Published | Fully active across commercial channels. | Syndicated to digital storefronts, POS registers, and order management systems. | Completeness score reaches exactly 100% for the target channel. | Commercial discontinuation notice or emergency suspension trigger. |
| Suspended | Emergency commercial quarantine. | Immediate de-publication from search and registers; investigation of pricing/spec errors. | Catalog supervisor initiates immediate recall. | Rectified specification passes review or item is deprecated. |
| Deprecated | Phased commercial retirement (sell-down). | Existing warehouse stock may be sold; procurement reordering and manufacturing blocked. | Category manager declares end-of-life and assigns superseding SKU. | Physical stock hits exactly zero and all open orders are fulfilled. |
| Archived | Terminal historical record. | Permanent read-only viewing for financial, legal, and warranty audits. | Warehouse confirms zero stock and OMS confirms zero active orders. | Terminal State (cannot be reopened). |
2. Variant Matrix Generation Workflow
Creating physical variants for a configurable merchandise item follows an eight-stage combinatorial generation pipeline designed to eliminate duplicate option collisions:
flowchart TD
Step1["1. Select Option Axes<br/>e.g., Size, Color, Storage"] --> Step2["2. Populate Option Values<br/>Size: S, M, L | Color: Black, Navy"]
Step2 --> Step3["3. Compute Cartesian Matrix<br/>Calculate Theoretical Permutations"]
Step3 --> Step4["4. Curate Sparse Matrix<br/>Remove Non-Manufactured Combinations"]
Step4 --> Step5["5. Generate Alphanumeric SKUs<br/>Pattern: BRAND-STYLE-COLOR-SIZE"]
Step5 --> Step6["6. Assign Optical Barcodes<br/>Validate GS1 Modulo 10 Check Digits"]
Step6 --> Step7["7. Attach Physical Logistics Specs<br/>Gross Weight, Package Dimensions, Base UOM"]
Step7 --> Step8["8. Commit & Emit VariantCreated<br/>Locks Parent Product Option Axes"]
Generation Pipeline Stages
- Option Axis Selection: The merchandiser defines the dimensions along which the item varies (e.g.,
SizeandColor). - Value Binding: Standardized option values are assigned to each axis from the global dictionary (e.g.,
Small,Medium,Large). - Cartesian Permutation Calculation: The domain computes the theoretical combinatorial product ($|V| = \prod k_i$).
- Sparse Matrix Curation: The merchandiser deselects combinations that will not be produced (e.g., Navy / Small is excluded from manufacturing).
- Standardized SKU Formulation: Unique, human-readable SKU strings are generated adhering to enterprise naming conventions.
- Optical Barcode Assignment: Barcodes (EAN-13, UPC-A) are allocated and verified using GS1 Modulo 10 check-digit algorithms.
- Logistics Profile Attachment: Gross physical mass, packaged dimensions (L x W x H), and storage units of measure are attached.
- Transactional Commit: Child variant records are saved within the
Productaggregate, andVariantCreatedevents are dispatched.
3. Channel Publication & Syndication Pipeline
Syndicating product data to digital storefronts, mobile applications, and POS registers follows a strict publication pipeline:
sequenceDiagram
participant User as Merchandiser
participant Action as PublishProductAction
participant Gate as Channel Completeness Gate
participant Trans as Channel Payload Transformer
participant Bus as Enterprise Event Bus
participant Edge as Storefronts & Edge CDN
User->>Action: execute(productId, targetChannel)
Action->>Gate: evaluateReadiness(product, targetChannel)
alt Completeness < 100%
Gate-->>Action: CompletenessGateViolation(missingAttributesList)
Action-->>User: Abort & Return Detailed Missing Field Checklist
else Completeness == 100%
Gate-->>Action: Readiness Approved (OK)
Action->>Trans: transformChannelScopedPayload(product, targetChannel)
Trans-->>Action: ChannelScopedPayloadDTO
Action->>Bus: emit(ProductPublished, ChannelSyndicated)
Bus->>Edge: Purge Edge Cache & Refresh Search Index
Action-->>User: Success (Catalog Item is Live)
end
Preconditions for Channel Syndication
- Product status must be In Review (or already Published when syndicating routine specification updates).
- The channel completeness vector must evaluate to 100% across all mandatory attributes.
- All required regional language translations for the target channel must be populated.
- At least one verified primary image asset tagged with the role
hero_imagemust be attached. - For configurable merchandise, at least one child variant SKU must be complete and active.
4. Bill of Materials (BOM) Formulation Lifecycle
Engineering recipes for assembled goods, manufactured items, and commercial bundles follow a controlled lifecycle governed by Engineering Change Notices (ECN):
flowchart TD
DraftBOM["Draft BOM Revision<br/>e.g., Rev A (In Engineering)"] --> AddComp["Add Components, Quantities & Scrap %"]
AddComp --> CheckAcyclic{"Directed Acyclic Graph<br/>(DAG) Check Passed?"}
CheckAcyclic -->|Circular Loop Detected| RejectLoop["Reject: CircularDependencyException"]
RejectLoop --> AddComp
CheckAcyclic -->|Valid DAG| EngReview["Costing & Manufacturing Feasibility Review"]
EngReview --> Approval{"Engineering Sign-Off?"}
Approval -->|Changes Needed| AddComp
Approval -->|Approved| ApprovedBOM["Approved BOM Revision<br/>Permanently Locked & Immutable"]
ApprovedBOM --> EmitBOM["Emit BOMRevisionApproved Event"]
EmitBOM --> Downstream["Consumed by Manufacturing Work Orders & Subcontracting"]
ApprovedBOM -->|Engineering Change Notice (ECN)| NewRev["Create Draft Revision B"]
BOM Governance Rules
- Draft Revision: Engineers can freely modify components, adjust consumption quantities, and calibrate scrap percentages.
- Approved Revision: Once formal sign-off is committed, the revision is permanently read-only. Active shop floor work orders reference this immutable revision.
- Engineering Changes: Any alteration to component parts, substitute materials, or quantity ratios mandates instantiating a new sequential revision (e.g.,
Rev B).
5. Comprehensive State Transition Matrix
The table below outlines all allowable state transitions, required guard conditions, emitted events, and domain outcomes:
| Current State | Action Trigger | Guard Condition / Invariant Checks | Next State | Emitted Domain Event | Practical Enterprise Outcome |
|---|---|---|---|---|---|
| None | CreateProduct | Name valid; Attribute Family exists; Master Category leaf resolved. | Draft | ProductCreated | Product container initialized; audit record written. |
| Draft | BeginEnrichment | Assigned editor ID is valid; mandatory shell parameters present. | In Enrichment | ProductEnrichmentStarted | Enrichment tasks assigned to copywriting and photography teams. |
| In Enrichment | GenerateVariants | Option axes valid; complete Cartesian coverage; no duplicate option tuples. | In Enrichment | VariantMatrixGenerated | Child variant SKUs created; parent option axes permanently locked. |
| In Enrichment | SubmitForReview | Required family attributes complete; hero image attached; active variants exist. | In Review | ProductSubmittedForReview | Catalog QA notified; editing interface switches to read-only. |
| In Review | RejectReview | Actionable rejection reason code and deficiency notes supplied. | In Enrichment | ProductReviewRejected | Editor notified with a specific checklist of required fixes. |
| In Review | PublishToChannel | Target channel completeness score is exactly 100%; required locales complete. | Published | ProductPublished | Catalog item syndicated to external storefronts, OMS, and POS registers. |
| Published | SuspendProduct | Valid suspension justification code provided by catalog supervisor. | Suspended | ProductSuspended | Immediate channel de-publication; edge CDN cache purged; scanner lookups blocked. |
| Suspended | ReactivateProduct | Corrective audit verified; completeness confirmed at 100%. | Published | ProductReactivated | Item restored to active syndication feeds and sales channels. |
| Published | DeprecateProduct | Superseding SKU assigned (if applicable); sunset sell-down date declared. | Deprecated | ProductDeprecated | Storefronts flag clearance sell-down; purchasing blocks replenishment orders. |
| Deprecated | ArchiveProduct | Physical warehouse stock equals 0; all open customer orders fulfilled. | Archived | ProductArchived | Item permanently sealed as read-only historical record; search index delisted. |