Flow: Item Update¶
Trigger: An ERP or PIM system pushes updated item data to item-registry-api (REST) Key services: item-registry, studio-link-evaluator, studio-renderer, eslimage-merger, pricer-server Key DTOs: storeitemvalues, studiolink, studioeslimage, eslimage
Item data changes are one of the most frequent events in the system — prices change daily, promotional flags toggle, names are corrected. When updated data arrives at item-registry-api, it writes a new storeitemvalues DTO. studio-link-evaluator subscribes to these changes and re-evaluates every link that references the affected item. The critical idempotency point is here: if the re-evaluation produces exactly the same studiolink as before (same resolved design, same item reference, same render context hash), no write is performed and the pipeline terminates immediately — no re-render, no re-transmit, no unnecessary churn on the ESL hardware. Only if the evaluation result genuinely differs (a different design has become the winner, or a property value used in the label has changed) does the pipeline continue through render and transmit. This behaviour keeps the system efficient at scale: a store with thousands of ESLs can process a bulk price update without re-rendering every label unnecessarily.
Steps¶
-
ERP/PIM → item-registry-api: The external system calls the
item-registry-apiREST endpoint with the updated item payload. The API accepts the request, validates the item identifier against the tenant/store scope, and appliesitemprocessingparametersrules: if the item is previously unknown and theaccept_unknown_itemsparameter is false, the update is rejected; if SIC (Store Item Catalogue) behaviour is enabled, additional validation applies. -
item-registry → DTOflow (storeitemvalues):
item-registryprocesses the validated update and writes a newstoreitemvaluesDTO (id:t/{tenantid}/s/{storeid}/items/{itemid}/values). The DTO is a flat key-value map of all item fields received from the ERP/PIM, plus metadata (source system, ingestion timestamp). -
DTOflow (CQS) → studio-link-evaluator: CQS emits a change notification on
storeitemvalues.studio-link-evaluatorsubscribes tostoreitemvalueschanges. It fetches the updated values and looks up alllink.v2DTOs that reference this item (via theby_itemalias onstudiolink:t/{tenantid}/s/{storeid}/items/{itemid}/studiolink). This may be multiple links if the same item is displayed on several ESLs. -
studio-link-evaluator — evaluation: For each link referencing the item (looked up via the
by_itemalias onstudiolink),studio-link-evaluatorfetches thelink.v2and the relevantcommunicationpack, then re-evaluates the CEL scenario rules with the newstoreitemvalues. It computes the new winning design ID and render context (a deterministic hash of the inputs that affect the rendered output).
Where does
communicationpackcome from?communicationpackis owned by studio-scenario-library. It is a tenant-level (or store-level) container of CEL scenario rules: each rule pairs a condition (a CEL expression over item properties, store context, etc.) with a target design.studio-link-evaluatordoes not writecommunicationpackitself — it only reads. When a scenario library author publishes new rules, the correspondingcommunicationpack.v1write triggersstudio-link-evaluatorto re-evaluate all affected links the same way an item-value change does.
- Idempotency check — pipeline fork:
- If evaluation result is unchanged (same design ID, same render-context hash as the existing
studiolink):studio-link-evaluatordoes not write a newstudiolink. The pipeline stops here for this ESL. No re-render, no re-transmit. -
If evaluation result changed (different design selected, or render-context hash differs because a bound property value changed):
studio-link-evaluatorwrites an updatedstudiolinkDTO and the pipeline continues from step 6. -
DTOflow (CQS) → studio-renderer: CQS emits a change notification on
studiolink.studio-rendererfetches thestudiolink, the resolveddesignDTO, and the newstoreitemvalues. It re-renders the PNG with the updated item data. -
studio-renderer → dtoflow-lfs + DTOflow (studioeslimage): The new PNG is uploaded to dtoflow-lfs and a new
studioeslimageDTO is written with the updatedfile_path. The old PNG in LFS is superseded. -
DTOflow (CQS) → eslimage-merger: CQS notifies
eslimage-merger. The merger re-runs its priority logic (Studio wins over ECC), writes an updatedeslimageDTO pointing to the new PNG. -
DTOflow (CQS) → pricer-server: CQS notifies
pricer-serverof the updatedeslimage. It fetches thestoreesl(for hardware routing) andesldriver(for rotation), downloads the new PNG from dtoflow-lfs, and pushes it to the physical ESL over RF/IR. -
ESL hardware acknowledgment: The physical ESL renders the new image and acknowledges.
pricer-serverupdates its internal state DB and PUTsstoreeslstatusaccordingly (remainsOKfor a label that was already linked; transitions back toOKif it was inROAMING).
Sequence diagram¶
sequenceDiagram
participant ERP as ERP/PIM System
participant IR as item-registry
participant DTOflow
participant SLE as studio-link-evaluator
participant SR as studio-renderer
participant Merger as eslimage-merger
participant PS as pricer-server
participant ESL as Physical ESL
ERP->>IR: POST /items/{id} (updated values)
IR->>DTOflow: Write storeitemvalues DTO
DTOflow-->>SLE: CQS: storeitemvalues changed
SLE->>DTOflow: Fetch link.v2 DTOs by_item alias
SLE->>DTOflow: Fetch communicationpack
Note over SLE: Re-evaluate CEL with new item data
alt Evaluation result unchanged (same design + render context)
Note over SLE: No write — pipeline stops here
else Evaluation result changed
SLE->>DTOflow: Write updated studiolink DTO
DTOflow-->>SR: CQS: studiolink changed
SR->>DTOflow: Fetch studiolink, design, storeitemvalues
SR->>DTOflow: Upload new PNG → dtoflow-lfs
SR->>DTOflow: Write studioeslimage DTO
DTOflow-->>Merger: CQS: studioeslimage changed
Merger->>DTOflow: Fetch studioeslimage + ecceslimage
Merger->>DTOflow: Write eslimage DTO
DTOflow-->>PS: CQS: eslimage changed
PS->>DTOflow: Fetch eslimage, storeesl, esldriver
PS->>ESL: Push updated PNG over RF/IR
ESL-->>PS: Acknowledge image received
PS->>DTOflow: Write storeeslstatus → OK
end
Key DTOs involved¶
| DTO | Role in this flow | Page |
|---|---|---|
storeitemvalues.v1 |
Updated item data that triggers re-evaluation; flat key-value map from ERP/PIM | storeitemvalues.v1 |
link.v2 |
Fetched by studio-link-evaluator to find all ESLs affected by this item | link.v2 |
communicationpack.v1 |
CEL scenario rules evaluated against the new item values to determine winning design | communicationpack.v1 |
studiolink.v1 |
Updated only if evaluation produces a different result; the idempotency gate for the whole pipeline | studiolink.v1 |
studioeslimage.v1 |
New rendered PNG produced only when studiolink changes | studioeslimage.v1 |
eslimage.v1 |
Merged authoritative page image; updated only when studioeslimage changes | eslimage.v1 |
Related flows¶
- Item–ESL Linking — steps 6–10 of this flow are identical to steps 6–10 of the linking flow; linking flow contains the full detail
- Design Publication — a design change also triggers studio-link-evaluator re-evaluation; same idempotency logic applies