More about decision tables
When you learn more about decision tables, you can better understand how to use decision tables in a way that most efficiently meets your business scenarios. For example, you can understand how decision tables are related to selected methods and activities, and how these connections affect processing at run time.
Evaluating a decision table
In an activity, to evaluate a decision table and derive a value, your application can use the following objects:
- The Property-Map-DecisionTable method
- The standard DecisionTable.ObtainValue() function
- The pxEvaluateDecisionTable utilities library
- The standard @baseclass.DecisionTableLookup activity
For more information about calling objects from an activity, see Configuring steps in an activity.
Property-Map-DecisionTable method
To evaluate a decision table and save the result as the value of a property, in an activity, call the Property-Map-DecisionTable method. As parameters, enter the target property name and the name of the decision table. For more information, see Property-Map-DecisionTable method.
DecisionTable.ObtainValue standard function
In an activity, you can call the standard DecisionTable.ObtainValue function to evaluate a decision table. Use the following syntax:
Lib(Pega-RULES:DecisionTable).ObtainValue(tools, myStepPage, DecisionTableName)
For more information about calling objects from an activity, see Configuring steps in an activity.
pxEvaluateDecisionTable utility library
In an activity, you can call the pxEvaluateDecisionTable utility library to evaluate a decision table. Use the following syntax:
Lib(Pega-RulesEngine:Utilities).pxEvaluateDecisionTable(PrimaryPageName, DecisionTableName)
For more information about calling objects from an activity, see Configuring steps in an activity.
Performance
Pega Platform does not limit the number of rows in a decision table. However, as a best practice to avoid slow performance when updating the form and also avoid the Java 64 KB code maximum, limit your decision tables to no more than 300 to 500 rows.
Special processing with Declare Expression calls
When you create a Declare Expression rule, you can incorporate the result of a decision table by providing the result property of the decision table in the Set Property To field. Special processing occurs at run time when a property from the decision table is not present on the clipboard. Such decision rules fail with an error message, and the system returns the Otherwise value from the decision table instead.
Not declarative
Despite the class name, the Rule-Declare-DecisionTable rule type does not produce forward or backward chaining. Technically, decision tables are not a declarative rule type.
Previous topic More about Decision Trees Next topic More about Map Values