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:
- 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:
"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:
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
- 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.
- Within a single cell, values separated by commas represent alternative values for that variable.
- In order for the action(s) of a rule column to be executed, ALL of the conditions in that column must be met.
- An empty condition cell means that particular factor is not relevant to that rule.