Matrix Rule
  • Updated on 05 Mar 2019
  • 2 minutes to read
  • Print
  • Dark
    Light

Matrix Rule

  • Print
  • Dark
    Light

This document demonstrates how to create and use a Matrix Rule in Decisions .Matrix Rules are different from Truth Tables in that Matrix Rules can only output one value.

The image below is a completed example of a Matrix Rule that evaluates an animal type (dog or cat), animal breed and animal age. The Matrix Rule result will output a monthly insurance premium.
2018-10-22_144226-2.jpg

Configure the Rule:
In this example create a Matrix Rule that evaluates three different inputs. The inputs will evaluate the data and then output the proper String value. Begin in the Designer Folder and select Create Rule and choose Matrix Rule . In the resulting window, name the Rule and select Create to open the Matrix Rule designer. Note: Observe that it is slightly different than Rule Designer in Decisions . On the work-space, there is a matrix preset for to build horizontal and vertical steps to evaluate data. Configure the Matrix Rule using the properties tab on the right side of the Rule Designer. 
Select Setup Input Data above the workspace. 
2018-10-22_140329.jpg

Select Setup Input data, by selecting that action button on the top right of the designer**.** Add input data to the rule and select close to save the data. 
2018-10-22_140430.jpg

First, hover over the ADD RULE row on the workspace and select the (+) symbol 
2018-10-22_145000.jpg

After ADD RULE is selected the Add After steps show as seen in the image below (Figure 5).  Only rules based on the Data are offered (i.e. Dates, List, Numbers, Text). 
largefilehandler.ashx.png

Seatch for the StringMatch Step step from Add After [Catalog] > Data > Text category, and select Add .
2018-10-22_140522.jpg

Once this rule is added an Edit Rule dialog will appear, allowing the designer to configure the rule**.** Rename the rule to a relevant name for what the rule is looking for. Possible Matches is what the rule will compare the inputs to. Select the Input from a flow and choose an animal type. 
2018-10-22_140615.jpg

On each Possible Match more steps can be applied from the Add Step window by selecting the (+) symbol. Select (+) next to Dog.
2018-10-22_140828.jpg

Add another String Match Step Rule. Configure it as follows, select close to save. 
2018-10-22_141059.jpg

Select the (+) next to Cat and add another String Match Step Rule and configure it as follows, then close to save. 
2018-10-22_141329.jpg

The matrix rule should look like the following screenshot. To configure the columns select the (+) next to ADD RULE.
2018-10-22_141420.jpg

The column rule will evaluate the animals age. Choose the Number Range rule located in All Rules > Data > Numbers. Rename the rule and define the Number Ranges as follows, close to save. 
2018-10-22_143811.jpg

Within the Properties panel, under Output Data , change the Output Type to String. The Matrix rule should look like the below screenshot.
2018-10-22_142621.jpg

Within the blank spaces select the pencil icon to edit the Output for that specific column and row. After filling out all the empty spaces, select Debug.
2018-10-22_144226-1.jpg

The Debugger opens and allows the tester to enter Dynamic Data . This Matrix Rule can live within a flow and use forms or other ways to input data, for testing purposes this example is solely focused on creating the Matrix Rule. Once the data is entered select Run.
2018-10-22_143425.jpg

The Matrix Rule runs and gives the output of from the corresponding input. The data entered was a Beagle , age 3 .
2018-10-22_144256.jpg

Was this article helpful?