Create a Grouped Decision Matrix
Learning Objectives
After completing this unit, you’ll be able to:
- Create a grouped decision matrix.
- Test the grouped decision matrix using an expression set.
Prepare the Hotel Cost Plan
Take an example of a hospitality company that has a chain of hotels in multiple cities and provides different types of rooms. The hotel room per-night charges depend on the city and breakfast options. The company wants to revise ‌room charges for each city. All the details are captured in these tables for easier reference.
New York City | ||
---|---|---|
Room Type |
Breakfast Included? |
Per-Night Price (USD) |
Standard |
No |
40 |
Standard |
Yes |
50 |
Executive |
No |
60 |
Executive |
Yes |
70 |
Superior |
No |
80 |
Superior |
Yes |
90 |
San Francisco | ||
---|---|---|
Room Type |
Breakfast Included? |
Per-Night Price (USD) |
Standard |
No |
50 |
Standard |
Yes |
55 |
Executive |
No |
75 |
Executive |
Yes |
80 |
Superior |
No |
95 |
Superior |
Yes |
100 |
Create a Grouped Decision Matrix
Now that you know the requirements well, it’s time to create a grouped decision matrix.
Here’s how you do it.
- Click
, then find and select Business Rules Engine.
- Click
and then select Lookup Tables.
- Click New.
- Select Decision Matrix, and then click Next.
- Enter these details.
- Name:
Hotel Room Cost
- Type: Grouped
- Group Key:
City
- Name:
- Save your work.
You’ve successfully created the grouped decision matrix.
Update the Group Key Value for the First Version
Next, create the group decision matrix versions to capture the requirements for each city. Start with editing the first grouped decision matrix version created earlier for New York City.
- On the Hotel Room Cost decision matrix record page, click the Related tab.
- In the Decision Matrix Versions related list, click Hotel Room Cost V1.
- Click Edit.
- For Name, remove the existing name and enter
Hotel Room Cost NYC
.
- For Group Key Value, enter
New York City
.
- Save your changes.
Add Column Headers to the Decision Matrix
Next, add the specific input and output columns based on the column headers in the New York City requirements table.
- On the Hotel Room Cost NYC matrix record page, click the Matrix tab.
- Click Add Column.
- On the Add Column window, provide these details.
- Column Header:
Room_Type
- Header Type: Input
- Data Type: Text
- Column Header:
- Click Add Column.
- Provide these details for the second column.
- Column Header:
Breakfast_Included
- Header Type: Input
- Data Type: Boolean
- Column Header:
- Click Add Column.
- Provide these details for the third column.
- Column Header:
Per_Night_Price
- Header Type: Output
- Data Type: Currency
- Column Header:
- Click Done.
Add Rows and Data to the Decision Matrix
Now, add rows and data in each row of the matrix. To capture the data mentioned in the Breakfast Included column, use the boolean data type.
- Click Add Row.
- In the Room_Type column, hover over the first row, and click
.
- For room type, enter
Standard
.
- In the Per_Night_Price column, hover over the first row, and click
.
- For per-night price, enter
40
.
- Repeat steps 1–5 to enter data for the remaining room types. For room types that include breakfast, click
in the Breakfast_Included column and select the checkbox.
- Save your changes. If the table with the added data doesn’t appear, refresh the page.
- Click Activate.
In the decision matrix, the Boolean data type column has a checkbox to indicate whether the column is included or not. If the checkbox is selected, the column is included and if the checkbox isn't selected, the column isn't included. You use the Boolean data type in a True or False input scenario.
Create a New Grouped Decision Matrix Version
Now, create a new version of the grouped decision matrix to capture the details for San Francisco from the Hotel Room Cost grouped decision matrix.
- In the Hotel Room Cost decision matrix record page, click the Related tab.
- Click New.
- Provide these details.
- Name:
Hotel Room Cost SF
- Rank:
2
- Version Number:
2
- Group Key Value:
San Francisco
- Name:
- Save your work.
- Just like you did for New York City in the previous section, add rows and data for the San Francisco grouped decision matrix version.
- Save your changes.
- Click Activate.
That’s it! Your grouped decision matrix versions are now ready. Easy right?
You can create multiple decision matrix versions within the same decision matrix, but each version must have a unique rank. You can simultaneously activate multiple versions of a decision matrix. When you call a decision matrix and more than one activated version of the decision matrix exists, the version with the highest rank is chosen. For example, if two activated versions have rank 1 and rank 2, the version with rank 2 is chosen.
Add the Decision Matrix to an Expression Set
You must be excited to see your grouped decision matrix in action. You can call the decision matrix in an expression set to test it. Here’s how you do it.
First, create an expression set.
- Click
, then find and select Expression Sets.
- Click New.
- For Name, enter
Get Hotel Room Cost
.
- For Usage Type, select Default.
- Save your changes.
- On the Details page, under the Expression Set Versions related list, click Get Hotel Room Cost V1. The expression set version opens in the Expression Set Builder.
- In the Expression Set Builder, click
.
- For Rank, enter
1
.
- Save your changes.
Next, call the grouped decision matrix from the expression set version. To do that, add a lookup table step element in the Expression Set Builder canvas.
- In the Expression Set Builder canvas, click
.
- Find and select Lookup Table.
- In the Lookup Table Details field, find and select Hotel Room Cost.
- Save your changes.
Simulate and Test the Decision Matrix
Awesome! You’ve added the grouped decision matrix to the expression set version. Now, it’s time to test it. To verify that the grouped decision matrix works as expected, simulate the expression set version with a few sample input values.
- In the Expression Set Builder canvas, click Simulate.
- Under Variables, provide this input data.
- Breakfast_Included: True
- City:
San Francisco
- Room_Type:
Executive
- Breakfast_Included: True
- Click Simulate.
- Click
in the canvas for results.
The per-night price calculated based on the entered input data comes to $80. The results match the data as defined in the San Francisco table. Congratulations! The grouped decision matrix is working as expected.
In this unit, you learned how to create a grouped decision matrix and its versions. You also learned how to use the grouped decision matrix in an expression set and test it. In the next unit, explore decision tables.