Decision Table Syntax and Semantics - Gnorion/BizVR GitHub Wiki

Decision Table Syntax and Semantics

semantics expressions The generic structure of a decision table is this:

image

  • Cells above the blue line are conditions to be tested.
  • Those below the blue line are actions to be performed.
  • The first column contains the conditions and actions.
  • The second (and subsequent) columns each represent distinct rules (or situations).

Example:

image

"color" is the condition being tested. 'red' is the value its being tested against.

“price" is the name of a data element that will be set to the value 5 if the condition is true.

This rule can be read as "If color='red' then price=5"

You can have many conditions, actions and rules:

image

This represents three rules:

  • If color = 'red' or 'blue' then price = 5 and shipping = 'free'
  • if size = 'small' and shape= = 'square' then price = 10 and shipping = '$10'
  • if color = 'green' then price = 15 and shipping = '$20'

Interpretation

  1. The rule columns represent alternative possibilities i.e. either rule 1 or rule 2 or rule 3 etc may apply. Or possibly more than one rule may apply.
  2. Within a single cell, values separated by commas represent alternative values for that variable.
  3. In order for the action(s) of a rule column to be executed, ALL of the conditions in that column must be met.
  4. An empty condition cell means that particular factor is not relevant to that rule.