Ruleset
Last updated
Last updated
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.
Creating a Ruleset in Nected serves several essential objectives.
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.
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.
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.
To initiate the creation of a rule set on Nected, follow these step-by-step instructions:
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.
Initiate Rule Set Creation:
On the Rules page, locate and click on the "+ Create Rule" button.
Select Ruleset: From the options presented, choose "Ruleset" to start configuring a rule set.
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 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 ascending order.
Evaluate All - The rule will be executed anyhow even if the rules are not satisfied. It will run all the rules in parallel and then the output will executed altogether. The RuleSet 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.
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:
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.
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.
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.
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.
Additional Rule Management:
Adjacent to the toggle button, find a dropdown menu offering options to:
Add a row above: To add a new row above the current row.
Add a row below: To add a new row below the current row.
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.
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:
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.
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.
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.
Before Publishing your Ruleset, if you've used any draft rule, then change their version from draft to any live version(either latest live or any other live version), 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:
Publish to Production: You can publish the ruleset directly to production and use it over the API.
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:
Submit it for Review: If you're working in a team, and there is a reviewer, then you can assign the reviewer and submit the rule in review. Then it will go into the review flow, which you can read from the Approval Flow.
Publish the RuleSet: 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.
Note: If you've requested the dataset for a review, then only the reviewer can publish the dataset. Otherwise, you can simply publish the data source by clicking on the Publish button. Read more about it from Approval Flow.
If you edit a published Ruleset and re-publish the updated Ruleset, then it creates a new version of it. Now for any reason, if you want to check or roll back to a specific previous version, you can do that using the version Control tab. You can do this in two different ways:
At the top bar, you can see the Environment tabs with numbers written alongside. These numbers show how many versions you have for that environment. Like in the image, you can see that I've 1 Published versions and 1 Draft version of that. Now, you can click on the respective environment to access the Version Control section like this:
The second option is, you click on the just next icon of the settings icon, and it will open the Version Control section and from there you can access it.
To rollback to a previous version just click on the Rollback button on that version.
So, as discussed in the previous section, if you're editing the ruleset and then publishing it, then it creates a new version. But if you're using this ruleset in any workflow, and you want to check which version of this ruleset that workflow is using, then you can do that using the "Dependency Map" section. To do this follow this:
Click on the icon just below the Version Control icon, and it will open the Dependency Map section.
Inside the Dependency Map section, you'll have two tabs:
Using: In this tab, you can check which integration or rule, this ruleset is using.
Used by: In this tab, you can check which workflow is using this ruleset along with the version, as shown in the GIF.
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.
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.
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:
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.
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.
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.
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.