Page 275 -
P. 275

242     part 3  •  the analysis proCess

                                             A data structure with optional elements contained in parentheses or either/or elements con-
                                         tained in brackets will have a corresponding IF . . . THEN . . . ELSE statement in the process
                                         specification. Also, if an amount, such as QUANTITY BACKORDERED, is greater than zero,
                                         the underlying logic will be IF . . . THEN . . . ELSE. Iteration, indicated by braces on a data
                                         structure, must have a corresponding DO WHILE, DO UNTIL, or PERFORM UNTIL to control
                                         looping on the process specification. The data structure for the ORDER ITEM LINES allows up
                                         to five items in the loop. Lines 8 through 17 show the statements contained in the DO WHILE
                                         through the END DO necessary to produce the multiple ORDER ITEM LINES.

                                         Decision Tables
                                         A decision table is a table of rows and columns, separated into four quadrants, as shown in
                                         Figure 9.7. The upper-left quadrant contains the condition(s); the upper-right quadrant con-
                                         tains the condition alternatives. The lower half of the table contains the actions to be taken
                                         on the left and the rules for executing the actions on the right. When a decision table is used
                                         to determine which action needs to be taken, the logic moves clockwise, beginning from the
                                         upper left.
                                             Suppose a store wanted to illustrate its policy on noncash customer purchases. The company
                                         could do so using a simple decision table, as shown in Figure 9.8. Each of the three conditions
                                         (sale under $50, pays by check, and uses credit cards) has only two alternatives. The two alterna-
                                         tives are Y (yes, it is true) or N (no, it is not true). Four actions are possible:
                                           1. Complete the sale after verifying the signature.
                                           2. Complete the sale. No signature needed.
                                           3. Call the supervisor for approval.
                                           4. Communicate electronically with the bank for credit card authorization.

                                             The final ingredient that makes the decision table worthwhile is the set of rules for each of
                                         the actions. Rules are the combinations of the condition alternatives that precipitate an action.
                                         For example, Rule 3 says:
                                                 IF       N       (the total sale is NOT under $50.00)
                                                                                             AND
                                                 IF       Y       (the customer paid by check and had two forms of ID)
                                                                                      AND
                                                 IF       N       (the customer did not use a credit card)
                                                                                            THEN
                                                 DO       X       (CALL THE SUPERVISOR FOR APPROVAL).
                                             The foregoing example features a problem with four sets of rules and four possible actions,
                                         but that is only a coincidence. The next example demonstrates that decision tables often become
                                         large and involved.

                                         Developing Decision Tables
                                         To build decision tables, an analyst needs to determine the maximum size of the table; eliminate
                                         any impossible situations, inconsistencies, or redundancies; and simplify the table as much as


              Figure 9.7                                Conditions and Actions              Rules
              The standard format used for
              presenting a decision table.

                                                             Conditions               Condition Alternatives





                                                              Actions                    Action Entries
   270   271   272   273   274   275   276   277   278   279   280