Chapter 7 Working with Decision Tables : Tips on Working With Decision Tables

Tips on Working With Decision Tables
This section summarizes various actions you can take to work with decision tables:
Click Add to add rows. Enter the data in the new cells or drag and drop the properties from Argument Explorer.
Click Fit Content to resize the columns so they fit around the text.
Click the Show Text button to see the contents of the cell, instead of just the values you are comparing.
Click Merge Rows to merge two separate rows with the same data. You can toggle between merged and separated rows by clicking on this tab. If similar conditions are present in a decision table, they get merged into one cell for easier reading as with pivot tables.
The following figure shows two rows with the same condition (same gender) merged into one row:
The following figure shows two rows with the same condition (same gender) un-merged (separated out) into two separate rows:
Drag and drop the catalog functions you see collapsed by default on the right side of the application. Drag and drop them to the function area (marked by the ) or to the cell you are editing. For example, if you want to compare some attribute that is of type integer against the rounded value of 39.99, you could specify a condition < Math.round(39.99) by dragging and dropping the Math round function from the Standard Functions panel and then entering the arguments of that function.
To take a few actions relating to the column you have clicked on, right-click on the condition area on the properties you dragged there. For example, you can move the column, remove it, or change other field settings.
Click on the drop-down menu on the properties dragged to either the condition or the action area to filter out which rows to show based on the values. For example, if you want to see just the Account.AccountType where AccountType is "current" and you want to filter out all the other rows that do not have this value, selecting the "current" value from the drop-down list shows you all the values you have entered so far in that column.
Click Remove to delete rows. If you add more rows after this operation, the rows IDs are not reused.
Right-click on column headers and choose Remove to delete any conditions or actions from the table. You cannot remove the last condition column because a minimum of one condition column must exist if you have any action columns. When you remove columns, certain rows may also get merged if they now share the same values in their condition cells. If this happens, if you have non-custom actions and the rows have the same priority, the last row to be merged has its actions merged and the others deleted.
Select Table > Show Property, to see meta-data of the entire decision table. You can only modify the effective date and the expiration date as described in Setting Effective Dates.
Setting Row Priorities
The order in which rows are evaluated in a decision table is not specified. If you want to control which actions are taken first, you can change those rows to have a higher priority. Click anywhere inside that row. In the Rule Properties View, you can change the priority. All actions with higher priorities are executed before actions with lower priorities. Ten is the lowest priority and one is the highest.
Setting Effective Dates
To make a decision table execute only between certain dates, you can set effective and termination dates to it. For example, if you have certain rules that should only take effect on a certain date, you can set the effective date and no termination date. Select the Calendar wizard available in the Property View to specify a date and time.
These rules apply:
If both effective and termination dates are specified, the decision table is executed only if the current time is between these dates (inclusive).
It is not valid to have only an expiration date and not an effective date. Thus, if no effective date is specified, the expiration date is ignored. This means the table is executed every time it is invoked.
Context Menu Options for Decision Tables
You can perform certain actions on decision tables in the Project Explorer view using a context menu. Right click on one or more decision tables to see this menu. It enables you to rename, delete, export, generate class files, validate, deploy, show history, lock, release lock, and compare decision tables without having to open the tables. You can compare two different decision tables existing on the local machine or can compare a decision table with its latest copy on RMS.
The Show History, Lock, Release Lock, and Compare With (Approved Copy) options are enabled only when the user is logged on to Decision Manager.
Generate Class Option
A Generate Class option appears when the bui.gen.class.option property is set to true in bui-config.tra. Use this option to generate the class file for the selected decision table. Use the class, for example for testing purposes. For configuration instructions, see Configuring Decision Manager Properties.