Matrix RuleLast Updated: 10/22/2018 Introduced in Version: 4.1
This tutorial demonstrates how to create and use Matrix Rule in Decisions. Matrix rules differ from truth tables as matrix rules can only output one value.
The screenshot below is the finished Matrix Rule that evaluates an Animal Type, Breed and Age to output a monthly Insurance Premium.
Configure the Rule:
In this example create a Matrix Rule that evaluates three different inputs to output the proper String value.
Begin in the Designer Folder with selecting Create Rule > Matrix Rule.
In the resulting window we name the Rule and select Create.
Matrix Rule Designer opens. 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. On the right-hand side there is a settings panel where the rule will be configured.
Select Setup Input Data above the work space.
The data used in this example will be defined as follows, select close to save.
First, hover over the ADD RULE row on the work space and select the (+) symbol
Add Step dialog window pops up. This is the same Add Step window with all Steps that we can use in the Flow Designer. Select String Match Step step from All Steps [Catalog] > Data > Text category, and select Add.
Once this rule is added a 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 flow and choose Animal type.
On each Possible Match more steps can be applied from the Add Step window by selecting the (+) symbol. Select (+) next to Dog.
Add another String Match Step Rule. Configure it as follows, select close to save.
Select the (+) next to Cat and add another String Match Step Rule and configure it as follows, then close to save.
The matrix rule should look like the following screenshot. To configure the columns select the (+) next to ADD RULE.
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.
Within the Properties panel, under Output Data, change the Output Type to String. The Matrix rule should look like the below screenshot.
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.
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.
The Matrix Rule runs and gives the output of from the corresponding input. The data entered was a Beagle, age 3.