Ruleset

In Nected, a rule set is a collection of published simple rules & decision table that work in tandem to filter and act upon input attributes (could be datasets as well) based on specified conditions. The primary purpose of creating a rule set is to streamline and optimize the filtering process by combining multiple rules. This allows users to efficiently organize and apply rule conditions to achieve desired outcomes for their conditions. The rule set serves as a cohesive unit, leveraging the results of individual rules to collectively influence the dataset filtering process. This documentation provides a step-by-step guide on creating, configuring, testing, and utilizing rule sets within the Nected platform.

Objectives of Creating a Ruleset

Creating a Ruleset in Nected serves several essential objectives.

  1. Firstly, it allows users to consolidate and organize multiple published rules, including both Simple Rules and Decision Tables. This consolidation simplifies the management of complex rule structures, providing a centralized location for configuring and executing diverse sets of rules.

  2. Secondly, Rulesets facilitate the efficient handling of conditions and outcomes collectively. By grouping related rules, users can streamline the decision-making process and manage the logic governing their datasets more effectively.

  3. Additionally, Rulesets enhance reusability, enabling users to apply a predefined set of rules across different datasets or scenarios. This promotes consistency and reduces the effort required to replicate rule configurations.

Overall, the primary objectives of creating a Ruleset are to enhance organization, streamline decision logic, and promote the reusability of rule configurations for more efficient data management.

Creating the Rule Set in Nected:

To initiate the creation of a rule set on Nected, follow these step-by-step instructions:

  1. Access Nected and Navigate to the Rules Page:

    • Log into your Nected account using your email ID and password.

    • Once logged in, navigate to the Rules page by clicking on the "Rules" option in the left navigation panel.

  2. Initiate Rule Set Creation:

    On the Rules page, locate and click on the "+ Create Rule" button.

  3. Select Ruleset: From the options presented, choose "Ruleset" to start configuring a rule set.

  4. Ruleset Configuration Form:

    The ruleset configuration form will open, prompting you to provide essential details:

    • Name: Assign a unique and descriptive name for the rule set. Ensure that the name is distinct across the entire Nected platform and does not contain spaces.

    • Ruleset Type: Specify whether the rule set is for staging or production purposes.

    • Ruleset Description: Add a meaningful description that outlines the purpose and function of the rule set.

    • Rule Policy: Same as DecisionTable. Choose a rule policy from options such as First, Unique, Collect, Order, or Evaluate All. This policy dictates how the decision table within the rule set will execute. Here are all the rule policies:

      • First – The rule will exit after the first true value. For example, if you check for a BMW car of 2005 model in New York city in a table of cars, this policy will show only the first result even if the table has 5 entries that meet this condition.

      • Unique – The rule will exit after finding the first unique true value. For example, if you check for a BMW car of 2005 model in New York city in a table of cars, this policy will not show any result because the table has multiple entries that meet this condition, thus it does not have a unique entry.

      • Collect – The rule will collect all the true values. For example, if you check for a BMW car of 2005 model in New York city in a table of cars, this policy will show all 5 results in the exact same order as they are listed in the table.

      • Order – The rule will display all the true values in the ascending order. For example, if you check for a BMW car of 2005 model in New York city in a table of cars, this policy will show all 5 results in the ascending order.

      • Evaluate All - The rule will be executed anyhow even if the rules are not satisfied. The decision table result contains the output entries of all satisfied, unsatisfied and the rules with error in the order of the rule specified in the decision table.

Follow these guidelines meticulously to configure the rule set according to your specific requirements. Once configured, this rule set can be a powerful tool to collectively apply conditions to your datasets.

Adding Rules to the Rule Set

After configuring the basic details of your rule set, the next crucial step involves adding individual rules to it. Follow these steps to seamlessly integrate rules into your rule set:

  1. Add Rule to Ruleset:

    Within the ruleset configuration window, locate the "Add Rule" option. Click on it to start incorporating rules into your rule set.

    You can add any simple rules or decision tables inside the ruleset irrespective of their status. This means you can add published or even in draft rules inside the ruleset. However, before publish the ruleset, you must publish the draft rules first.

  2. Add Multiple Rules:

    If your rule set requires multiple rules to form a comprehensive condition, use the "Add Rule" option again to incorporate additional rules.

  3. Rule Table Format:

    The added rules are presented in a table format within the configuration form. The first column displays the names of the selected rules, the second column showcases the results of each rule, and the third column features toggle buttons for rule enablement or disablement.

  4. Toggle Enable/Disable:

    Each rule added to the rule set is accompanied by a toggle button. This button allows you to enable or disable specific rules within the rule set.

  5. Additional Rule Management:

    Adjacent to the toggle button, find a dropdown menu offering options to:

    1. Add a row above: To add a new row above the current row.

    2. Add a row below: To add a new row below the current row.

    3. Delete the current row.

Utilize these functionalities to seamlessly integrate and manage rules within your rule set. Once added, these rules collectively contribute to the conditions that the rule set will evaluate against your datasets.

Testing the Rule Set

Once you've configured and added rules to your ruleset, it's time to ensure that the conditions set by these rules produce the desired results. Navigate to the testing button i.e. "Test in Staging" within the Nected platform. Then follow these steps to effectively test your rule set:

  1. Input Attributes:

    Provide the necessary input attributes required for the ruleset to be evaluated against. This could include various parameters or data points that your ruleset depends on for decision-making.

  2. Result Visualization:

    Upon initiating the test, observe the output of all the rules incorporated into the ruleset. The results are presented in a clear and structured JSON format, allowing you to comprehend the collective outcomes of the rules.

  3. Action Status Messages:

    Examine the action status messages displayed in the testing window. These messages detail the actions performed for both successful and failed rule evaluations. Each action is associated with a specific rule, providing transparency in the rule set's execution.

Publishing the Rule Set

Before Publishing your Ruleset, if you've used any draft rule, then publish the draft rule(s) first, and then proceed further. Make sure all your rules used inside the ruleset are published.

Once you've configured your ruleset condition, result, and actions, you will see two options on the screen:

  1. Publish to Production: You can publish the ruleset directly to production and use it over the API.

  2. Request for Review: You can assign an approver to validate your ruleset

If you select the "Request for Review" button, it will follow the approval flow, which you can read about in detail here.

However, if you choose to publish the rule, there are a few things you should know about the publish flow.

The rule starts in a draft state. You can make any necessary edits to ensure it meets your requirements. Once you've done with the editing, you now can do two things:

  1. Publish your workflow: If you don't want to review your rule by an approver, then you can also directly publish your rule in production. Here is how you can do that:

    • When you are ready to publish, click the "Publish" button.

    • Title and Description: A prompt will appear asking for a title and description of the changes. This information helps maintain a clear version history.

    • Confirm Publishing: After providing the title and description, click the publish button to move the rule to production. The rule is now published and it will create a new published version that you can access from the Publish tab of the Version Control section. This version is live in the production environment.

For more details about version control, and rolling back to a previous version, read the Version Control doc.

Triggering the Rule Set

After successfully publishing your ruleset, the next step is to trigger it, allowing the defined conditions to be applied to your selected datasets. In the "Trigger" tab within the ruleset configuration. Click on ⚙️ button to trigger the ruleset from your systems via API.

For more details, read this documentation: Trigger Rule via API.

Schedule the Ruleset

Scheduling is an independent step that allows you to schedule the corn job for your rule. If you’re testing the rule, i.e. if your ruleset is currently in staging, then you can click on test the scheduler by simply clicking the “Test Schedule” button. And it will run the cron job, for the first 10 rows of the database and return the result for them. After testing, you can also create a scheduler for your published rule from the “Create Schedule” button at the same place in the production environment. You can read more about it from the doc Scheduler.

Settings for a Rule Set

Configuring settings for your ruleset is crucial for defining its behavior and ensuring it aligns with your specific requirements. Follow these steps to set up key parameters for your ruleset:

  1. Start Date:

    Specify the start date for your ruleset to become active. This ensures that the defined conditions and actions only come into effect from the specified date onwards. The ruleset becomes active immediately upon publication if no start date is provided.

  2. End Date:

    Optionally, set an end date for your ruleset. This determines the period during which the ruleset remains active. Once the end date is reached, the ruleset automatically becomes inactive. If no end date is specified, the ruleset remains active indefinitely.

  3. Rule Order:

    Establish the order in which rules within the ruleset should be executed. The rule order is crucial when multiple rules exist, as it determines the sequence of conditions being applied. This can significantly impact the overall outcome of the ruleset.

  4. Rule Status (Active or Inactive):

    Choose the status of your ruleset, indicating whether it is active or inactive. An active ruleset executes its conditions and actions based on the specified triggers. Inactive rulesets, on the other hand, do not affect the datasets, providing flexibility in managing the ruleset's operational status.

By carefully configuring these settings, you gain control over when and how your ruleset operates. Whether it's defining a specific timeframe, establishing a rule execution order, or toggling the ruleset's active status, these settings contribute to the precision and effectiveness of your ruleset within the Nected platform. Regularly review and adjust these settings as needed to adapt to changing business requirements.


As you keep using Nected, you might want to check out other features like the Simple Rule and DecisionTable. The Simple Rule is handy when you need straightforward, nested if/else rules to determine a single outcome based on matching results. On the other hand, the Decision Table lets you organize and run multiple rules simultaneously, making it easy to handle various conditions and outcomes in one go.

Last updated