PIM

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 StageWhat Occurs at this StagePermitted Business ActionsEntry Gate CriteriaExit Gate Criteria
DraftConceptual 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 EnrichmentCross-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 ReviewFormal 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.
PublishedFully 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.
SuspendedEmergency 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.
DeprecatedPhased 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.
ArchivedTerminal 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

  1. Option Axis Selection: The merchandiser defines the dimensions along which the item varies (e.g., Size and Color).
  2. Value Binding: Standardized option values are assigned to each axis from the global dictionary (e.g., Small, Medium, Large).
  3. Cartesian Permutation Calculation: The domain computes the theoretical combinatorial product ($|V| = \prod k_i$).
  4. Sparse Matrix Curation: The merchandiser deselects combinations that will not be produced (e.g., Navy / Small is excluded from manufacturing).
  5. Standardized SKU Formulation: Unique, human-readable SKU strings are generated adhering to enterprise naming conventions.
  6. Optical Barcode Assignment: Barcodes (EAN-13, UPC-A) are allocated and verified using GS1 Modulo 10 check-digit algorithms.
  7. Logistics Profile Attachment: Gross physical mass, packaged dimensions (L x W x H), and storage units of measure are attached.
  8. Transactional Commit: Child variant records are saved within the Product aggregate, and VariantCreated events 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_image must 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 StateAction TriggerGuard Condition / Invariant ChecksNext StateEmitted Domain EventPractical Enterprise Outcome
NoneCreateProductName valid; Attribute Family exists; Master Category leaf resolved.DraftProductCreatedProduct container initialized; audit record written.
DraftBeginEnrichmentAssigned editor ID is valid; mandatory shell parameters present.In EnrichmentProductEnrichmentStartedEnrichment tasks assigned to copywriting and photography teams.
In EnrichmentGenerateVariantsOption axes valid; complete Cartesian coverage; no duplicate option tuples.In EnrichmentVariantMatrixGeneratedChild variant SKUs created; parent option axes permanently locked.
In EnrichmentSubmitForReviewRequired family attributes complete; hero image attached; active variants exist.In ReviewProductSubmittedForReviewCatalog QA notified; editing interface switches to read-only.
In ReviewRejectReviewActionable rejection reason code and deficiency notes supplied.In EnrichmentProductReviewRejectedEditor notified with a specific checklist of required fixes.
In ReviewPublishToChannelTarget channel completeness score is exactly 100%; required locales complete.PublishedProductPublishedCatalog item syndicated to external storefronts, OMS, and POS registers.
PublishedSuspendProductValid suspension justification code provided by catalog supervisor.SuspendedProductSuspendedImmediate channel de-publication; edge CDN cache purged; scanner lookups blocked.
SuspendedReactivateProductCorrective audit verified; completeness confirmed at 100%.PublishedProductReactivatedItem restored to active syndication feeds and sales channels.
PublishedDeprecateProductSuperseding SKU assigned (if applicable); sunset sell-down date declared.DeprecatedProductDeprecatedStorefronts flag clearance sell-down; purchasing blocks replenishment orders.
DeprecatedArchiveProductPhysical warehouse stock equals 0; all open customer orders fulfilled.ArchivedProductArchivedItem permanently sealed as read-only historical record; search index delisted.

Our Premium Sponsors

Obelaw is proudly open-source. Continued development, bug fixes, and community support are made possible by the generosity of our sponsors.

Sponsor Obelaw