- 10 Sep 2021
- 2 Minutes to read
About Matrix Rules
- Updated on 10 Sep 2021
- 2 Minutes to read
A Matrix Rule is a rule that can be made up of many different rows and columns. A Matrix Rule is used to evaluate data with settings that can be customized to each specific row or column. Each row and column can have specific parameters and a user can nest these rule evaluations within each row or column. When a Matrix Rule runs, it has an outcome result, each outcome from a horizontal column creates a column for our Matrix, and each outcome from the vertical row creates a row for the Matrix.
In this example, a user will provide the operating system platform, the software name, and the number of licenses needed and be given the total cost as the outcome.
- In a Designer Project, click CREATE RULE. Select Matrix Rule and click CREATE. Name the Rule and click CREATE.
- Click SETUP INPUT DATA.
- Add "Platform" and "Software" as String[Text] Type and "Licenses" as a Number [Int32] Type. Click CLOSE to save the input.
- On the Properties panel, change the Output Type to String [Text].
- On the left side of the Rule Matrix, hover over Add Rule and click the plus icon. Navigate to All Rules > Data > Text and select String Match Step. Change the name to "Platform Is" and click ADD.
- Under Possible Matches on the Edit Rule window, enter "OS Ultra 3" and "OS Super 4". Under the Inputs category, click Unknown and select Select From Flow. Select Platform and click DONE. Click CLOSE to save.A great feature of the Matrix Rule is that every value-added as a possible option for each column or row can have nested Rule evaluations attached to them, which further increases the depth of how refined the Rule logic can be.
- Select the plus icon next to OS Ultra 3. Navigate to All Rules > Data > Text and select String Match Step. Change the name to "Software Is" and click ADD.
- Add "Productivity Plus", "Maintenance 2.0", and "Quick Email" under Possible Matches. Under the Inputs category, click Unknown and select Select From Flow. Select Software and click DONE. Click CLOSE to save.
- Do the same for OS Super 4 and enter "Game Link", "Stream Vision", and "Controller UI" as the Possible Matches.
- Click Add Rule on the top of the Matrix Rule and navigate to All Rules > Data > Numbers and select Number Ranges. Enter "Number of Licenses" for the step name and click ADD.
- Under Number Ranges, click Add New. Enter number ranges for 1-20, 21-50, and 51-80. Under Inputs click Unknown and select Select From Flow. Select Licenses and click DONE. Click CLOSE to save.
- Hover over a cell and click the pencil icon to edit the field. After added values to each cell, click Save to save changes.
- On the top action bar, click Debug.
- When the debugger runs, enter "3" for Licenses, "OS Ultra 3" for Platform, and "Quick Email" for Software. Click Run Capturing All.The Matrix Rule with evaluate the inputs and output the outcome.