LogiView

Executing Decision Tables

 
  • Decision tables are executed by line or by column.
  • If a rule is true, the condition is checked in the following line.
  • If a rule is not true, the program returns to the first condition line and the next rule is checked.
  • If all conditions in a rule column are true, the actions of the corresponding rule column are executed depending on the action indicator ("yes", "no").
  • If the value of a variable is unknown, it is requested automatically.
 

Example:

 

 

 

Line C 10: Comment

Will be ignored.

Line B 10: Condition

The value for DOCU_INT_1 is not available during the first run; therefore, a query window is displayed.

Line B10, column R01: Rule 1

Upon entry of the value 2 the program checks if the condition in the first rule column (R01) is true (DOCU_INT_1=1).

Line B10, column R02: Rule 2

Since 2 = 1 is not true, the condition of the second rule column (R02) is checked (DOCU_INT_1 = 2).

The condition 2 = 2 is true and further conditions do not exist. Therefore, the actions of rule column 2 are checked.

Column R02, line A 10 : Action

The first action of the rule column 2 is: put (rnd ( 23.2641758,1)), Action indicator: no. Therefore, this action is not executed.

Column R02, line A 20 : Action

The second action of the rule column 2 is: put (rnd ( 23.26417580,2)), Action indicator: yes. Since the action indicator is set to "yes" in this case, the result of the "put" function is issued.

Column R02, lines A 30 and A40: Action

The third and forth action of rule column 2 is not executed due to the "no" setting of the action indicator.

If the decision table is specified as Single Match Table, the execution stops.

Line B 10, column R03: Condition (only in case of multi-match tables)

In a Multi-match Table the program returns to the first condition line (B10) and rule 3 (R03) is checked.

The condition 2 = 3 is not true and further conditions do not exist. Therefore, the execution stops here.

Line B 10, column ELSE

The actions in this column are executed if no condition is true (in this example this would be the case if DOCU_INT_1 were e.g. 6). The message "Please enter a number between 1 and 3!" is displayed and the execution stops.