Skip to content

external_logic_items

Overview

Branch conditions imported from an external tool (CS's logic_item). Several conditions within one logic are combined with AND.

Table Definition

Logical name Physical name Column Type PK Relation Unique Nullable Default Notes
External branch condition external_logic_items id uuid โ—ฏ gen_random_uuid()
external_logic_id uuid external_logics:id (cascade)
external_id bigint logic_item ID on the CS side
cond_question_external_id bigint โ—ฏ Source question ID of the condition
cond_answer_item_external_id bigint โ—ฏ Target choice ID. null is also allowed
cond_sub_item_external_id bigint โ—ฏ Matrix column ID; row ร— column makes it cell-level
value text โ—ฏ Comparison value. Empty for selection types, a string for pulldown and FA
verb integer โ—ฏ Condition operator
order_index integer โ—ฏ Position within the logic. Values can repeat
raw jsonb Raw JSON of the logic_item object

Relations

  • external_logic_id โ†’ external_logics.id (onDelete: cascade)

Indexes

  • Primary key (id)
  • UNIQUE INDEX: external_logic_items_logic_external_id_idx (external_logic_id, external_id)

verb (Condition Operators)

The mapping confirmed from real CS traffic.

verb CS UI label Design tool operator
0 includes equals / includes
1 does not include not_includes
2 is only only
3 has other than has_other
4 is not only not_only

There is no dedicated verb for answered (FA has an answer); it is expressed as verb 3 with an empty value ("there is input other than empty").

Condition Expression per Question Type

Question type How the choice is identified value
Selection (SA / MA) cond_answer_item_external_id Empty string
Matrix cond_answer_item_external_id (row) + cond_sub_item_external_id (column) Empty string
Pulldown Shares the first answer_item_id The choice text (e.g. ็ฆๅฒก็œŒ)
Text input (FA) cond_answer_item_external_id (field; -1 = any, -2 = all) The text to match

Notes

  • Selection types and pulldown differ: selection types identify the target by answer_item_id and leave value empty, whereas pulldown judges by the string in value. Pushing into CS must account for this difference
  • FA text matching: CS can branch on free-answer content ("includes" appears to be a partial match). The design tool expresses this by reusing includes / not_includes
  • raw also contains score_group_id / score fields. CS score logic rides on logic_items, but this system does not support it