Menu

Rules

Rules use conditions and statements to bring business intelligence to your model.

Rules consist of a list with conditions and statements as key-value pairs. We've made a selection of conditions with which you can create logical flows. Statements can be typed with a combination of tokens: values , operators , references and functions .

Rules are executed in the order they are written.

Syntax

Help
rules:
  string:
    - condition: statement
    ...
  ...

Examples

In this example, if frame_left is set to variant_2 , frame_right will also be set to variant_2 .

questions:
  frame_left:
    type: list
    outputs: [ id, price ]
    options:
      - [ variant_1, 100 ]
      - [ variant_2, 200 ]

  frame_right:
    type: list
    outputs: [ id, price ]
    options:
      - [ variant_1, 100 ]
      - [ variant_2, 200 ]

rules:
  rule1:
    - if: $frame_left.outputs.id == variant_2
    - then: $frame_right.outputs.id = variant_2

In this example, frame_right will be set automatically according to frame_left.

questions:
  frame_left:
    type: list
    outputs: [ id, price ]
    options:
      - [ variant_1, 100 ]
      - [ variant_2, 200 ]

  frame_right:
    type: list
    outputs: [ id, price ]
    options:
      - [ variant_1, 100 ]
      - [ variant_2, 200 ]

rules:
  rule1:
    - match: $frame_left.outputs.id
    - case: variant_1
    - then: set( $frame_right, variant_1 )
    - case: variant_2
    - then: set( $frame_right, variant_2 )
Menu