Conditional Rule Sets
  • 03 Jun 2022
  • 2 Minutes to read
  • Dark
    Light

Conditional Rule Sets

  • Dark
    Light

Article Summary

Overview

Rule Sets are a set of Rules in Decisions that are targeted to work together in a process of complex data evaluation. Conditional Rules provide the ability to create Rule Sets within a Rule Set. A Conditional Rule Set may evaluate conditions to determine if this Rule Set needs to be executed and may extend Rule Set input data.

Example

In this example, a Conditional Rule Set within this Rule Set will define the conditions which will determine whether or not to run the Rule Set. Then, a Flow will test the Conditional Rule SetBelow is a downloadable example to import into Decisions. 


  1. In the Designer Project, click CREATE RULE on the Global Action Bar. Select Rule Set, name the Rule (Pet Premium Rule Set), and click CREATE.
  2. On the Rule Set action bar, click Setup. Under the RULE SET DATA, click ADD NEW.
  3. Name the Input Data "Pet Type" and click OK. Add another Input Data as "Age" with the Type of Int32.
  4. Under the SETUP category, select Scoring under Usage and Conditional under Rule Set Type. Then, click SAVE to save changes and close the dialog window.
  5. On the Rule Set action panel, click Create Rule Set [Conditional]. When the dialog box appears, provide a name for the Rule (Cat Premium Price) and click CREATE.
  6. Click the Pencil icon to edit the Rule.
  7. On the Rule Designer, create a Rule statement that evaluates if Pet Type equals Cat. Click Save and close the Rule Designer.


    If using multiple Rules, the order in which they will execute can be configured individually. On the Properties panel of the Rule under the SETTINGS category, enter a numerical value in the Order field under the Rule Set category.  


  8. On the Rule Set Designer, click Add Evaluation Rule on the Rule Set action bar with the Name of "Cat Premium Price". Then, click CREATE RULE.
  9. On the Rule Designer, create the Rule to evaluate if Age is less than or equal to 6. Enter "50" for the Result outcome data and "100" for the Else outcome data. Click Save and then close the window.
  10. Click Pet Premium Rule Set and click Create Rule Set [Conditional] with "Dog Premium" as the Name.
  11. On the Rule Designer, create a Rule statement that evaluates if Pet Type equals Dog. Click Save and close the Rule Designer.
  12. On the Rule Set Designer, click Add Evaluation Rule on the Rule Set action bar with the Name of "Dog Premium Price". Then, click CREATE RULE.
  13. On the Rule Designer, create the Rule to evaluate if Age is less than or equal to 6. Enter "75" for the Result outcome type and "125" for the Else outcome type. Click Save and close the window.



Debug

  1. On the top action bar, click Conditional Rule Sets.

  2. On the Global Action Bar, click CREATE FLOW. Select Flow when the dialog box appears. Then, name the Flow (Rule Set Test Flow) and select CREATE.
  3. On the Flow Designer, select and drag a Run Rule Set step to the workspace from the Rules category on the Toolbox panel.
  4. On the Properties panel, click PICK under the RULE SET CONFIGURATION category and select Pet Premium Rule Set.
  5. Under the INPUTS category, enter "10" as the Age and "Dog" as the Pet Type.
  6. Connect the Done path of the Start step to the Run Rule Set. Then, connect the Done path of the Run Rule Set to the End Step.
  7. Click Save to save changes. Then, click Debug on the top action bar. When the Debugger window opens, click START DEBUGGING.
    After the Flow runs, the View Input/Output Data will display that the Conditional Rules checked the Pet Type and ran the Evaluation Rule for the correct Conditional Rule.




Was this article helpful?