6.3. Decision Tables

6.3.1. Spreadsheet Decision Tables

Rules can be stored in spreadsheet decision tables. Each row in the spreadsheet is a rule, and each column is either a condition, an action, or an option. The Red Hat JBoss BRMS Development Guide provides details for using decision tables.

6.3.2. Uploading Spreadsheet Decision Tables

Procedure 6.4. Uploading a Spreadsheet Decision Table

  1. To upload an existing spreadsheet, select New ItemDecision Table (Spreadsheet).
  2. Enter a name for the spreadsheet and then click Choose file... button to browse and select the spreadsheet. You can only select .xls files. Click the Ok button when done.
To convert the uploaded spreadsheet to a Guided Decision table:
  1. Validate the uploaded spreadsheet by clicking on the Validate button located on the project screen menu bar.
  2. Now click on the Other drop down menu on the project screen toolbar and select the Convert to Guided Decision Table option.

6.3.3. Spreadsheet Decision Table Examples

We are here considering a simple example for an online shopping site which lists out the shipping charges for the ordered items. The site agrees for a FREE shipping with the following conditions:
  • If the number of items ordered is 4 or more and totaling $300 or over and
  • If delivered at the standard shipping day from the day they were purchased which would be 4 to 5 working days.
The listed shipping rates are as follows:

Table 6.1. For orders less than $300

Number of items Delivery Day Shipping Charge, N = Number of Items
3 or less
Next Day
$35
2nd Day
$15
Standard
$10
4 or more
Next Day
N*$7.50
2nd Day
N*3.50
Standard
N*2.50

Table 6.2. For orders more than $300

Number of items Delivery Day Shipping Charge, N = Number of Items
3 or less
Next Day
$25
2nd Day
$10
Standard
N*$1.50
4 or more
Next Day
N*$5
2nd Day
N*2
Standard
FREE
The above conditions can be presented in a spreadsheet as:
Decision Tables can also be mapped based on actions and conditions as shown in the following format:
To explain the above format in detail we use a simple example of sending an email to a recipient with following conditions:
  • Send an email when Recipient address is present, subject is present and before 5:30pm
  • If after 5:30pm, then put it in the pending folder
  • If Recipient address is missing, give a warning message
  • If all fields are present and before 5:30, send the email
The Decision table can be mapped as follows:

Table 6.3. Decision Table Mapping

  Criteria   Mapped Entries
Conditions (IF)
Address Present
Y
Y
Y
Subject Present
Y
Y
Y
Before 5:30
Y
Y
Y
Actions (THEN)
Send Mail
X
Error Message
X
X
Make Pending
X
The above example is a limited-entry decision table where the condition alternatives are simple boolean values and the action entries are marked to reprsent which actions in the given columns are to be performed. For example if the condition alternatives are mapped for all 3 conditions - Address present, Subject Present and Before 5:30, the action entry is marked for action as Send Mail. So if all the three conditions are satisfied, the action will be to send the mail.