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¶
-
Designer → Studio UI: The designer opens Studio, selects an ESL type (e.g.
NEWTON_26two-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. -
Studio UI → studio-design-library: The designer clicks Publish. Studio UI calls the
studio-design-libraryservice, which validates the design (schema correctness, all referenced assets resolvable), transitions the design record fromDRAFTtoPUBLISHED, and marks it immutable. -
studio-design-library → DTOflow:
studio-design-librarywrites thedesignDTO 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. -
DTOflow (CQS) → studio-link-evaluator: CQS emits a change notification for the
designDTO.studio-link-evaluatorsubscribes todesignchanges. It looks up alllink.v2DTOs (via theby_designalias onstudiolink) that reference this design, either directly viaforced_design_idor as the winning candidate returned by scenario evaluation. -
studio-link-evaluator → DTOflow: For each affected link,
studio-link-evaluatorre-runs its CEL (Common Expression Language) evaluation against the currentlink.v2,communicationpack, andstoreitemvalues. If the result changes (different resolvedforced_design_idor updated render context), it writes a newstudiolinkDTO. If the evaluation result is identical, it skips the write — the pipeline naturally stops here for those ESLs. -
DTOflow (CQS) → studio-renderer: CQS emits change notifications for any new or updated
studiolinkDTOs.studio-renderersubscribes tostudiolinkchanges. For each notification it fetches thestudiolink, the referenceddesign, and the currentstoreitemvaluesfor the bound item. -
studio-renderer → dtoflow-lfs + DTOflow:
studio-rendererrenders the layout with live item data into a PNG. It uploads the PNG to dtoflow-lfs (obtaining afile_path) and writes astudioeslimageDTO that records thefile_path,rotation, and source metadata. -
DTOflow (CQS) → eslimage-merger, pricer-server: The new
studioeslimagetriggers 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 |
Related flows¶
- 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