In this post your will learn How to configuring decision tables and decision trees in Pega 8
Decision Tables and Decision Trees:
- These are the fundamental to enforcing business decisions.
- Decision rules will be used in flows, routers, activities, and declare expressions.
- Both will allow you to design complex decision logic.
- It will be used to test the values of multiple properties to answer questions.
- It evaluate against the same set of properties or conditions.
- Decision tables resemble a spreadsheet with rows and columns.
- Organization may choose to delegate to business users responsibility for updating the decision table.
- A delegated decision table allows the users to quickly adjust the table to make the update, rather than waiting for IT to make the required changes.
- You can reference decision tables in the decision shapes to decide which connector to use when advancing a case in a process.
- It can also use in declare expressions, activities, or routers.
Configure a decision table:
- To create a decision table, in the Application Explorer, select a class. Then right-click and select Create > Decision > Decision Table.
Specify a condition property or expression:
- Click on the Conditions cell opens the Decision Table property chooser tool.
- Select a property or create an expression used for the evaluation.
- Enter a label that appears on the table.
- Select the comparison operator.
Specify the condition:
- In the rows under the conditions column, enter the value you want to compare during the evaluation.
- You can enter a literal value, a property, or an expression.
- Multiple rows can be added for each combination of conditions.
- If you have more than one condition column, you must enter a condition in at least one column.
Specify the return value:
- Under the Return column, enter a literal value, a property, or an expression.
- This is the result the table returns if all the conditions in the row evaluate to true.
Specify the otherwise value:
- Make sure to add a value in the otherwise rows to ensure that the decision always returns a result.
- Processing error can occur if there is no result.
Return Multiple results:
- Under the Results tab, if you enable the Evaluate all rows option.
- The decision table evaluates all rows defined in the decision table.
- if the condition is true, the decision table performs the actions and returns an array of results that can be parsed.
- Decision tables can be used to handle logic that calculates a value from a set of test conditions.
- It evaluates against different properties or conditions.
- Like decision tables, you can reference decision trees in flow shapes, declare expressions, activities, or routers.
Decision Tree Logic:
- To create a decision tree, in the Application Explorer, select a class. Then right-click and select Create > Decision > Decision Tee
- Decision trees contain condition branches — a comparison value, a comparison operator, and an action.
- The action can be to return a result, to continue the evaluation, or stop the evaluation.
- When the decision tree is invoked, the system evaluates the top row and continues until it reaches a result that evaluates to true.
If the condition evaluates to true, the system returns a result value that you define in the field to the right of the drop-down.
Causes the next branch of the decision tree to nest within this branch. The system indents the next branch on the form.
Select only as the last result for a branch. Typically, you use this option when configuring indented branches.
Note: As a best practice, enter a default return value in the otherwise row at the bottom of the tree. This helps ensure that there is a returned value if no other conditions evaluate to true.
Hope you learned How to configuring decision tables and decision trees in Pega 8.