- 01 Jul 2022
- 4 Minutes to read
Creating a Rule Set
- Updated on 01 Jul 2022
- 4 Minutes to read
Rule Sets are a set of Rules and Flows that are targeted to work together for 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.
Rule Set Configuration
- In the Designer Project, click CREATE RULE on the Global Action Bar. Select Rule Set.
- In the Element Gallery, expand the Rule Set section and then select, name, and create a Rule Set.
- On the Rule Set action bar, click Setup. Below is an overview of each property.
|Integration Type||Sets the Integration Settings for the Rule Set, allowing the Rule Set to be accessed outside of Decisions. By default, this is set to None|
Rule Set Data
|Inputs||Defines the input datatypes used by the Ruleset|
|Usage||Depending on the selected Usage type, this will affect the output of the Rule Set|
|Logical||Outputs either a True or False boolean when the Rule Set completes|
|DataReturn||Ouputs a Data object when the Rule Set completes. Used for data manipulation|
|Scoring||Outputs a numerical value when the Rule Set completes. When this option is selected, a new option for Scoring Strategy becomes available.|
|Rule Set Type||Determines how the Rule Set will be ran|
|Template w/ Instances||Used for creating a base set of Rules with specific sub sets for different cases|
|Instance||Used for creating only a single set of the Rule set to be ran|
|Conditional||Used for creating a Rule Set within a Rule Set.|
|Sort by Order before Run||Sorts the Rules based on the execution order|
|Instance Create Name||The name for a created instance of the Rule Set during run time|
|Show Messages for Expired or Disabled Items||Creates a log message when expired or disabled Rules are ran|
|Stop Processing On Exception||Causes the Rule Set to end when an exception is thrown|
|Flows - Evaluation||Enables Flows to be created to evaluate data within a Rule Set|
|Flows - Evaluation/Data Addition||Enables Flows to be created to evaluate and add additional data within a Rule Set|
|Flows - Transform Data||Enables Flows to be created which manipulate existing data within a Rule Set|
|Action Rules||Enables Rules that trigger different Rules or Flows to execute based on its outcome|
|Rule Tables||Enables Rule Tables to be created within a Rule Set|
|Truth Tables||Enables Truth Tables to be created within a Rule Set|
|Matrix Rules||Enables Matrix Rules to be created within a Rule Set|
|Tree Rules||Enables Tree Rules to be created within a Rule Set|
|Allow Interceptor Rules||Enables Interceptor Rules to be created within a Rule Set|
|Show All True Path||Displays an All True outcome path when the Rule Set is used within a Flow|
|Show All False Path||Displays an All False outcome path when the Rule Set is used within a Flow|
|Path For No Rule Result||Determines what path the Rule Set will travel if there is no result|
|Defined Outcome Paths||Used to define additional outcome paths for the Rule Set|
|Done Path Name||Updates the name for the Done outcome path|
|Output Error List||Outputs a list of errors that occurred when the Rule Set is ran|
|Output False List||Output a list of Rules that returned a False result|
|Output No Result List||Outputs a list of Rules that returned no result|
|Output Not Run List||Outputs a list of Rules that did not run when the Rule Set executed|
|Output True List||Outputs a list of Rules that returned a True result|
|Result Data Storage||Determines what data will be stored within the Rule Set. By default this value uses Header.|
|Result Extension Type||Determines the Rule Set's Result extension type used to store executed data|
|Store Not Run||Stores executed data for Rules were not ran|
Creating a Rule Set
In this example, a Rule Set will be created and house a Conditional Rule Set. Then, a Flow will test the Conditional Rule Set. Below is a downloadable example which can be imported into Decisions.
- Input data to the Rule set will need to be defined. Select Setup.
- Under RULE SET DATA > Inputs, click ADD.
- Define the Input Data. In this case, Location (String) and Amount (Double) are configured as inputs.
- Under the SETUP, select Conditional for Usage and Conditional for Rule Set Type. Then, click SAVE to save changes and close the dialog window.
- On the Rule Set action panel, click Create Rule Set [Conditional]. When the dialog box appears, provide a name for the Rule set and click CREATE.
- New Rules can be defined using the Add Evaluation Rule. To edit existing rules, click on the Pencil Icon.
- The Rule Designer will open where the Rule can be updated/defined.
Running a Rule Set in a Flow
- Create a new Flow.
- In the Toolbox, select and drag a Run Rule Set from the Designer Entities > Rules category onto the workspace.
- On the Properties panel, click PICK under the RULE SET CONFIGURATION category and select the created Rule Set.
- Define the inputs needed for the Rule Set.
- Since the Rule Set is a conditional Rule Set, the Inclusion Rule Control input is available.
This input sets the same execution Run Mode for all Evaluation and Intercept Rules, without the need to manually set the values. Below is an overview of the options available
|Run All||Runs all Rules within a Rule Set|
|Stop on First True||Stops the Rule execution on the first True result|
|Stop on First False||Stops the Rule execution on the first False result|
- Click Debug on the top action bar. When the Debugger window opens, click START DEBUGGING.
- After the Flow runs, the debugger will display the Rule Set that was running, along with the results for each individual Rule, depending on the Run mode configuration.
Adding Additional Rules
On the Rule Set Designer Folder, click Add Evaluation Rule on the Rule Set action bar, then, click CREATE RULE.
Setting Execution Order
If multiple Rules exist within a Rule Set, the order in which they will execute can be configured. Within a Rule Set, click Setup, then check Sort by Order before Run.
To set the execution order:
Edit the Rule. In the Properties panel of the Rule, check the SETTINGS category. Enter a numerical value in the Order field under the Rule Set sub category.
When the Rule is run through the debugger as part of a Flow, then the rules will execute in their configured order.