Skip to content

Communicationpack

Version: v1 (minor version 1) Scope: per-tenant Owning service: studio-scenario-library

A Communicationpack is a named container of scenarios that encodes the business logic for selecting which design to display on an ESL. Each scenario pairs a Conditions block (item/link property rules or a CEL expression) with one or more design IDs to use when those conditions are true. Scenarios nest: a pack holds a root Scenario, which may have child_scenarios, forming a tree. Evaluation is depth-first — child scenarios are checked before the parent falls back. The studio-link-evaluator service subscribes to communication packs and evaluates them at link-evaluation time to produce a studiolink — the resolved design ID for a specific ESL.

ID pattern

t/{tenantid}/communicationpacks/{communicationpackid}

Segment Meaning
t/{tenantid} Tenant scope
communicationpacks Fixed collection name
{communicationpackid} Opaque identifier assigned by studio-scenario-library

Schema

Field Type Description
id string Full resource name following the ID pattern above
display_name string Human-readable name shown in the Studio scenario library UI
scenarios Scenario The root node of the scenario tree

Scenario message

A Scenario is the fundamental unit of conditional design selection. The root scenario is held directly in scenarios; further levels are reached via child_scenarios.

Field Type Description
display_name string Human-readable name for this scenario node (e.g. Price Drop, Default)
description string Optional description of the business intent of this scenario
conditions Conditions The condition that must be true for this scenario to apply. See Conditions type below.
design_ids repeated string Short-form design IDs to use when conditions evaluates to true. Multiple IDs indicate that the rendering system may rotate through them or pick based on an additional rule.
child_scenarios repeated Scenario Child scenarios to evaluate before this scenario's own design_ids are used. Enables hierarchical specificity: more specific rules nest inside less specific ones.

Scenario tree evaluation

Evaluation is performed by studio-link-evaluator at the time a studiolink is produced for an ESL:

  1. Starting at the root Scenario, evaluate conditions against the item's properties (from Storeitemvalues) and link properties.
  2. If conditions matches, recurse into child_scenarios in order, attempting to find a more specific match.
  3. The deepest matching scenario's design_ids are used.
  4. If no child scenario matches, the current scenario's own design_ids are used.
  5. If the root scenario does not match, no design is selected (the ESL falls back to its previous design or a default).

Shared Conditions type

conditions uses the shared pricer.evo.dtos.shared.Conditions message from proto-template/pricer/evo/dtos/shared/conditions.proto:

Field Type Description
rule_match_type MatchType enum AND — all rules must match; OR — any rule must match
rules repeated Rule Flat list of structured Rule messages
cel_expression string A CEL (Common Expression Language) expression representing the condition. Either used standalone or as an alternative representation of the same logic in rule_match_type + rules.

CEL expressions

The cel_expression field holds a Google CEL expression evaluated against the item and link context. CEL provides a safe, sandboxed expression language that supports field access, comparison operators, string functions, and boolean logic. A simple example:

item.price < 10.00 && item.department == "Produce"

A more complex expression using a list membership check:

item.category in ["Dairy", "Bakery"] || item.isDiscontinued == "true"

When both cel_expression and rule_match_type/rules are set, they represent the same condition in two forms — the CEL expression is the canonical form used at evaluation time.

Rule types

Each Rule in the rules list identifies a property (item field name), a source (item or link), and one condition variant:

Variant Operators
StringRule IS_EQUAL_TO, IS_NOT_EQUAL_TO, CONTAINS, DOES_NOT_CONTAIN
NumericRule IS_GREATER_THAN, IS_EQUAL_OR_GREATER_THAN, IS_LESS_THAN, IS_EQUAL_OR_LESS_THAN, IS_EQUAL_TO, IS_NOT_EQUAL_TO
RangeRule IS_BETWEEN, IS_NOT_BETWEEN
ListRule IS_ONE_OF, IS_NOT_ONE_OF
NoValueRule IS_EMPTY, IS_NOT_EMPTY, IS_A_NUMBER, IS_NOT_A_NUMBER

Rules may have user_can_override = true, indicating that the Studio UI should allow store-level users to modify that specific rule value.

Consumed by

Service Why
studio-link-evaluator Subscribes to communicationpack.v1 and storeitemvalues.v1; evaluates the scenario tree for each ESL link to determine the design ID; writes the result as a studiolink
Studio scenario library UI Displays and edits communication packs and their scenario trees
  • designdesign_ids in scenarios reference Design record IDs; studio-link-evaluator resolves these to LFS paths for the renderer
  • storeitemvalues — item property values are the primary data source for condition evaluation
  • taskdefinition — also uses the shared Conditions type, but drives LED flash actions rather than design selection