- 10 Sep 2021
- 3 Minutes to read
About Matrix Rules
- Updated on 10 Sep 2021
- 3 Minutes to read
A Matrix Rule is a Rule that can be made up of many different rows and columns connected with two axis. It 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 set for Rule evaluations, and other Rule evaluations can be nested within. When a Matrix Rule runs it has an outcome result, each outcome from a horizontal column creates a column for the Matrix, and each outcome from the vertical row creates a row for the Matrix.
One example of a Matrix Rule can be demonstrated through the use of automated emails. The automated emails can be different depending on the day of the week and can have a different outcome depending on the individual email and specific day of the week.
The screenshot below shows a sample Matrix Rule. This Rule is used to output a value based on the Platform, Software, and Licenses. The Rule will evaluate the input and render the specific output value based on the criteria. For example, if Platform = OS Ultra 3, Software = Quick Email, and Number Of Licenses = 26-50 the value of 800 would be output. This example is created in the steps below.
- In a Designer Folder, select the CREATE RULE button on the top Action Bar.
- Select the large Matrix Rule tile in the top right or navigate to the Matrix Rule section and select it there.
- Provide a name for the Rule, then select CREATE.
- In the Rule Designer, select the SETUP INPUT DATA button at the top.
- Configure the input data with Platform [String], Software [String], and Licenses [Int32] - none of which are lists. Save and close the Data Definitions window.
- Under the SETTINGS section of the base Rule properties on the right, the Behavior Type is set to Matrix Rule and the Rule Type is set to Matrix [Two Axis].
- Change the Output Type to String [Text] under the OUTPUT DATA section.
- On the left side of the Designer, hover over Add Rule and select the plus icon.
- Navigate to All Rules > Data > String Match Step and select it so that the text edit box appears.
- Change the name to something specific to the Matrix, then select ADD.
- Under the INPUTS section, select the Pick button for String to Match, then choose the Platform [String] input data from the list.
- Under the SETTINGS section, click into the Possible Matches box and enter some platform names as sample data. This example logic is configured to evaluate against two Platform values.
- Once the Possible Matches have been added, they will appear as a new row under the Platform Is Rule.
- Hover the cursor over a Software value and select the plus icon next to it.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.
- Navigate to or search for the String Match Step, provide a relevant name to the step, then configure some sample data as Software values in Possible Matches.
- Select the Pick button under the INPUTS section for String to Match and choose the Software [String] input data.
- Repeat this process of adding a Software Is Rule and sample data to the other Platform value.
- Hover over the Add Rule header at the top and select the plus icon that appears.
- Navigate to All Rules > Data > Numbers > Number Ranges, then provide a name relevant to the Matrix. This example uses "Number of Licenses" to indicate that this is a range of License [Int32] quantities.
- Under the INPUTS section, select the Pick button for Number to Evaluate, then choose the Licenses [Int32] input data.
- Under the OUTCOME SETUP, select ADD NEW under the Number Ranges box to add an applicable range of numbers for the expected value. This example uses License ranges of 20-25, 26-50,51-75, and 76-100.
- Now that all of the possible input values for Platform, Software, and Licenses have been configured into the Rule, corresponding output values will need to be configured in the boxes where the pencil icon appears on hover. The values in this example are random Int32 values.
- Select Debug from the top Action Bar.
- Enter some values for the expected input data that will match somewhere in the Matrix Rule.
- Select the START DEBUGGING to observe how the data is evaluated to reach an outcome in the Rule.