-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Overview [Requires Finialization]
The Quote block is the basic unit of the natural language descriptions. The basic pattern of each block is as follows:
IF [field_referenced] [condition]
THEN [conditional_field] must be [allowed values]
ELSE [conditional_field] [allowed values] (if applicable)

Each block represents a conditional restriction object from the schema.
Implementation note
This ticket outlines and focuses on basic if/then/else block rendering. Rendering Conditions and allowed values have there own tickets linked here:
- rendering conditions
- rendering allowed values click the links provided.
Quote Block Patterns
Pattern 1: Single restriction with else (creates one quote block)
JSON Structure:
{
"if": {
"conditions": [
{ "fields": ["image_format"], "match": { "value": "PNG" } }
]
},
"then": { "codeList": ["pipeline_A", "pipeline_B"] },
"else": { "codeList": ["pipeline_C", "pipeline_D"] }
}
UI Render Pattern:
IF image_format EQUALS "PNG"
THEN image_pipeline must be one of: pipeline_A, pipeline_B
ELSE must be one of: pipeline_C, pipeline_D
Pattern 2: Multiple restrictions (creates multiple quote blocks)
JSON Structure:
[
{
"if": {
"conditions": [
{ "fields": ["image_format"], "match": { "value": "PNG" } }
]
},
"then": { "codeList": ["pipeline_A", "pipeline_B"] }
},
{
"if": {
"conditions": [
{ "fields": ["image_format"], "match": { "value": "SVG" } }
]
},
"then": { "codeList": ["pipeline_C", "pipeline_D"] }
}
]
UI Render Pattern:
Quote Block 1:
IF image_format EQUALS "PNG"
THEN image_pipeline must be one of: pipeline_A, pipeline_B
Quote Block 2:
IF image_format EQUALS "SVG"
THEN image_pipeline must be one of: pipeline_C, pipeline_D
Pattern 3: Nested restrictions in else (treated as separate quote blocks)
JSON Structure:
{
"if": {
"conditions": [
{ "fields": ["image_format"], "match": { "value": "PNG" } }
]
},
"then": { "codeList": ["pipeline_A", "pipeline_B"] },
"else": [
{
"if": {
"conditions": [
{ "fields": ["image_format"], "match": { "value": "SVG" } }
]
},
"then": { "codeList": ["pipeline_C", "pipeline_D"] },
"else": { "codeList": ["pipeline_E"] }
}
]
}
UI Render Pattern:
Quote Block 1:
IF image_format EQUALS "PNG"
THEN image_pipeline must be one of: pipeline_A, pipeline_B
Quote Block 2:
IF image_format EQUALS "SVG"
THEN image_pipeline must be one of: pipeline_C, pipeline_D
ELSE must be one of: pipeline_E
Note
Instead of rendering nested else
structures as complex indented blocks, treat any nested conditional restrictions within an else
array as new quote blocks. If the first condition doesn't match, you naturally look at the next one. Since field values are mutually exclusive (a field can't be both "PNG" and "SVG"), separate blocks are clearer than nested indentation.