Step 3: Changing the Decision Table Configuration

Step 3: Changing the Decision Table Configuration

Decision table has a set of configurations that influence different aspects of its functionality and the actions that business users can perform. The decision table configuration object has default values, which you can change. Part of the configuration of the decision table can be exposed to the end user via the decision table Settings dialog box.

If you are using a data object with reference attributes as the result data object, then the attributes of the target data object will also be displayed as result attributes. For more information on reference attributes, see Attributes in Data Objects.

Preview

Decision Table with Settings Button

Decision Table Settings Dialog Box

Coding

You can view and download all files at Rule Builder - Guided Decision Table.

Note

The new code described in this step is not included in the download sample files.

Page.view.xml

Hidden
<mvc:View
        xmlns:mvc="sap.ui.core.mvc"
        displayBlock="true"
        xmlns="sap.m"
        controllerName="sap.rules.ui.sample.GuidedDecisionTable.Page"
        viewName="sap.rules.ui.sample.GuidedDecisionTable.Page.view"
        xmlns:rules="sap.rules.ui">
    <Button id="editButton" press="handleEditButton" text="Edit"/>
    <rules:RuleBuilder id="ruleBuilder" types="DecisionTable" editable="true">
		<rules:decisionTableConfiguration>
		<rules:DecisionTableConfiguration enableSettings="true"/>
		</rules:decisionTableConfiguration>
    </rules:RuleBuilder>
</mvc:View> 

This code changes the decision table to display and enable the Settings icon ( ), which opens the Settings dialog box.

Note

The Cell Format property of the decision table is deprecated from SAPUI5 version 1.52.8. The following is the new property is introduced.

Hidden
decisionTableFormat: {
                     type: "sap.rules.ui.DecisionTableFormat",
                     defaultValue: sap.rules.ui.DecisionTableFormat.CellFormat
                 }

The enum for type sap.rules.ui.DecisionTableFormat is

Hidden
sap.rules.ui.DecisionTableFormat = {
        CellFormat: "CELLFORMAT",
        RuleFormat: "RULEFORMAT" 
            };

The user has to set the enum type to RuleFormat for the DecisionTable to be rendered based on rule format.

The value for the rule format is set at the time of rule creation to either basic or advanced mode depending on which the entire rule will be rendered based on basic mode or advanced mode.