Skip to content

Flow: Design Publication

Trigger: A designer publishes a label design from draft state in the Studio UI Key services: studio-design-library, studio-link-evaluator, studio-renderer Key DTOs: design, studiolink, studioeslimage, eslimage

A designer creates a label layout — choosing fonts, binding item property fields, positioning elements — and publishes it. Publication is a one-way state transition: the design becomes immutable (no further edits) and is written as a design DTO to DTOflow. The CQS fan-out wakes every service that cares about design changes. studio-link-evaluator re-evaluates all links that reference this design (in case a forced design has been set, or the design has replaced another winning candidate), potentially producing new studiolink DTOs. studio-renderer then re-renders each affected ESL page, replacing the old studioeslimage with a freshly rendered PNG. The downstream pipeline — eslimage-merger and pricer-server — runs as normal once the new image DTO is in place.

Steps

  1. Designer → Studio UI: The designer opens Studio, selects an ESL type (e.g. NEWTON_26 two-inch display), and creates a new design. They place text elements bound to item properties (price, name, promotional flag) and static graphics. They may assign a preview item to see live data-driven output.

  2. Studio UI → studio-design-library: The designer clicks Publish. Studio UI calls the studio-design-library service, which validates the design (schema correctness, all referenced assets resolvable), transitions the design record from DRAFT to PUBLISHED, and marks it immutable.

  3. studio-design-library → DTOflow: studio-design-library writes the design DTO to dtoflow-spanner. The DTO contains the design ID, ESL type, property bindings, layout elements, and publication metadata (timestamp, author). Asset references point into dtoflow-lfs.

  4. DTOflow (CQS) → studio-link-evaluator: CQS emits a change notification for the design DTO. studio-link-evaluator subscribes to design changes. It looks up all link.v2 DTOs (via the by_design alias on studiolink) that reference this design, either directly via forced_design_id or as the winning candidate returned by scenario evaluation.

  5. studio-link-evaluator → DTOflow: For each affected link, studio-link-evaluator re-runs its CEL (Common Expression Language) evaluation against the current link.v2, communicationpack, and storeitemvalues. If the result changes (different resolved forced_design_id or updated render context), it writes a new studiolink DTO. If the evaluation result is identical, it skips the write — the pipeline naturally stops here for those ESLs.

  6. DTOflow (CQS) → studio-renderer: CQS emits change notifications for any new or updated studiolink DTOs. studio-renderer subscribes to studiolink changes. For each notification it fetches the studiolink, the referenced design, and the current storeitemvalues for the bound item.

  7. studio-renderer → dtoflow-lfs + DTOflow: studio-renderer renders the layout with live item data into a PNG. It uploads the PNG to dtoflow-lfs (obtaining a file_path) and writes a studioeslimage DTO that records the file_path, rotation, and source metadata.

  8. DTOflow (CQS) → eslimage-merger, pricer-server: The new studioeslimage triggers the standard merge-and-transmit pipeline described in the Item–ESL Linking flow (steps 7–10).

Sequence diagram

sequenceDiagram
    participant D as Designer
    participant UI as Studio UI
    participant SDL as studio-design-library
    participant DTOflow
    participant SLE as studio-link-evaluator
    participant SR as studio-renderer

    D->>UI: Create design, bind item properties
    D->>UI: Click Publish
    UI->>SDL: Publish design (draft → published)
    SDL->>DTOflow: Write design DTO
    DTOflow-->>SLE: CQS: design changed
    SLE->>DTOflow: Fetch link.v2 DTOs by_design alias
    SLE->>DTOflow: Fetch storeitemvalues, communicationpack
    SLE->>DTOflow: Write studiolink DTO(s) (if evaluation changed)
    DTOflow-->>SR: CQS: studiolink changed
    SR->>DTOflow: Fetch studiolink, design, storeitemvalues
    SR->>DTOflow: Upload PNG to dtoflow-lfs
    SR->>DTOflow: Write studioeslimage DTO
    Note over DTOflow: eslimage-merger + pricer-server<br/>continue per item-esl-linking flow

Key DTOs involved

DTO Role in this flow Page
design.v1 The published label layout; triggers the entire re-evaluation cascade design.v1
link.v2 Source of truth for which item is linked to which ESL and with which design constraint link.v2
studiolink.v1 Evaluated render instruction per ESL page; produced by studio-link-evaluator studiolink.v1
storeitemvalues.v1 Live item data fed into the renderer for data-driven label content storeitemvalues.v1
studioeslimage.v1 Rendered PNG output from studio-renderer; input to eslimage-merger studioeslimage.v1
eslimage.v1 Merged final image written by eslimage-merger; consumed by pricer-server eslimage.v1
  • Item–ESL Linking — describes the full pipeline from studiolink onward (steps 5–10 above are identical)
  • Item Update — another trigger that causes studio-link-evaluator to re-evaluate and potentially re-render