Overview
Last updated
Last updated
Nected's Rule engine offers an easy-to-use no-code editor to build any complex data-driven rules, integrated with your data sources, and thereafter allowing you to seamlessly execute actions on your database and/or trigger any of your internal & external flows based on rule outcome.
Once you integrate Nected with your database and create a dataset for the database connector, you can define conditions that are run on the datasets. The purpose of rules is to create a condition and search the database for that condition, then modify (insert/update) the database records based on the condition results.
Rules help you perform bulk database updates to ensure secure, quick, and accurate insert/update. You can also add a REST API connector using the Add Action option to invoke any of your HTTP-based internal as well as 3rd party APIs.
Creating a Nected rule involves the following steps:
Log into your Nected account and navigate to the Rules section on the left sidebar.
Click the + Create Rule button. A new popup will appear with two options:
Build your own: Here, you will need to enter a rule name, provide an optional description, and select the rule type. Available rule types include Decision Table, Simple Rule, and Rule Set.
Start from template: Select a pre-defined template to start configuring your rule based on common use cases.
Choose the appropriate option based on your requirements:
If you select Build your own, fill in the necessary details:
Enter the Rule Name.
Optionally provide a Rule Description.
Choose the Rule Type from the available options by clicking on the type you need. A brief description of each type is provided to help you make the right choice.
If you select Start from template, browse through the available templates and choose one that best fits your needs.
Depending on the chosen rule type or template, configure the rule by specifying conditions, actions, or both.
Optionally, connect to a Data Source if your rule requires direct data integration. This step is flexible and can be tailored to either use custom input parameters or connect directly to a database.
Test the rule to ensure it functions as expected in both your staging and production environments.
Publish the rule to make it live.
Finally, trigger the rule via API. You can find more details on how to do this in the API documentation.
Nected provides a pre-configured read-only rule, named Demo-Discount-Rule, based on the Demo-Product-DataSet. Click the Edit button to check and modify the configuration values for this rule.
The following figure shows the Rules page of the Nected platform:
Nected supports the following three types of rules:
SimpleRule – A straightforward if/then/else logic-based rule. A Simple Rule is suitable when you have single outcome based on a complex logic or for variety of logics. You can use it if you have complex if/else logic using multiple ANDs/OR in nested format. Simple Rules are ideal for use cases such as customer segmentations, dynamic discounts, recommendations etc.
DecisionTable – A matrix of conditions, outcomes, and actions covering diverse scenarios. Decision Tables are useful for defining multiple conditions and outcomes in a structured tabular format. This rule type is well-suited for use cases where decisions involve evaluating multiple variables or factors and have multiple outcomes based on each combo of variables. Common use cases include complex pricing structures, routing decisions, and product bundling.
Ruleset – A collection of preset rules collaborating for decision-making and action execution. A Ruleset allows you to organize and manage a collection of rules and decisions. This rule type is recommended when you have multiple rules that need to be applied in a specific order or as a group. Rulesets are valuable for scenarios involving lead allocation, referral programs, loyalty/rewards programs, and more.
Nected Rules enable you to manage rules in multiple environments.
Staging – The rule can be tested in a staging environment, which will use staging/ non-production integrations only and can be used to test Nected Rules before publishing. Such rules can be run either directly on the Nected platform via a Test console or via an API.
Production – A production rule, that queries as well as performs actions on production integrations. You can trigger rule production only via API and not via Test console since the test console supports testing in the staging environment only.
A Nected rule comprises of four important components –
Input Source - you can either pass any custom input parameters to the rule and/or select a dataset to pull the data points directly from your database instead of passing them every time you invoke the rule.
Conditions are the logic based on which the rule engine will determine which database rows/input params will be matching and accordingly return the result.
Result / Output Data is the output specified of the matching rule condition when you run the condition based on configured input source/params.
Action is used for either syncing rule outcomes back in systems or triggering any internal/external flows via the Nected database as well as REST API connectors.
Testing & Publishing Rules: You can test rule via the Test console as well as API. You would need to pass isTest:true
along with other API params. More info here. There are scenarios in which you won't be able to publish the Rule:
Rule showing error while clicking on "Test in Staging"
Rule Test was not successful via Test Console
The dataset integrated with Rules has not been published yet.
Triggering Rule via API: Trigger Nected Rule via API from your systems
Note: Any Rule that will be published without integration being published in production will end up giving an error in the API call response that "connector not published in production".
Based on the current configuration of the rule, it can be in any of the following three states:
Has Draft:
The "Has Draft" status is assigned to a rule when it is either newly created or when an existing published rule is being edited.
During the drafting phase, you have the flexibility to make changes and adjustments to your rule without affecting the live environment.
Has Tested:
After you have completed the editing process or made changes to a draft rule, you can initiate testing by clicking the "Test in Staging" button.
This action redirects you to the testing screen, where you can evaluate the rule's behavior and performance in a controlled staging environment.
Once testing is completed and you exit the testing screen, the rule status transitions to "Tested."
Published:
When you are satisfied with the rule's behavior during testing, you can choose to deploy it by clicking the "Publish" button.
Publishing the rule transitions its status to "Live," indicating that it is now active and will be executed in the production environment, making decisions for your customers.
Has Draft
The rule is created/edited and auto-saved, but it is not yet tested.
Testing via UI Console as well via API
Has Tested
The rule is tested, but it is not yet published.
Testing via UI Console as well via API
Published
The rule is published
Only via API
Refer to State Combinations to know more about possible usage of connectors, datasets, and rules as per their respecitve status.
Nected enables you to edit, clone, or delete a rule if your business requirement changes.
Follow this procedure to modify a rule:
Log into Nected with your Email ID and password.
Click Rules in the left navigation to open the Rules page.
Select one of the following options based on your requirement.
Click on the specific rule option to modify the rule. You can edit the rule name, data source, condition, result, and trigger information of a rule.
Now to clone and delete click on the three dot at the very right side of the specific rule option. After clicking, you'll see a dropdown:
Click Clone to duplicate the existing rule. You can modify a cloned rule using the same process.
Click Delete to remove a rule from your Nected platform. The Delete Rule dialog box opens. Click the Delete button on the dialog box to remove the rule.
You must update the rulesets after you delete a rule. Otherwise, the ruleset will fail. If the rule you are deleting is part of a ruleset, then you must first remove the rule from the ruleset configuration and then delete the rule.
Every time you edit a published rule, its version is automatically incremented by .10. For example, if the current version is .30, then after you modify the rule, its version will be .40. You can now control the version of a rule, and rollback to its previous version using our Version Control& rollback feature. You can read more about it in versioning & rollback.
Dependency Mapping, or Entity Mapping, is a powerful feature in Nected that allows users to visualize, track, and manage the relationships and dependencies between various entities within the platform. These entities include Integrations, Data Sources, Rules, and Workflows. Entity Mapping provides a comprehensive view of how different components interact, ensuring efficient data flow management and system integrity.
To access the dependency mapping inside your rule editor, follow these 2 steps:
Edit or View a Rule: Click on a specific rule to open its configuration or view mode.
Locate Dependency Map: Click on the 'Dependency Map' button (as shown in the image) on the right-hand side bar within the rule editor. This will display a map highlighting the relationships of this rule with datasets or integrations that the rule is using in the 'Using' tab and workflows or ruleset that are using this rule in the 'Userd by' tab.
Now, you can also import or export your rule irrespective of its state (draft/tested/published) and version. You can use that same version and state in other workspaces.
To learn more about the detailed steps and available options for importing and exporting rules, please refer to the Import/Export documentation.
Now that you understand the rules, their types, and states, let us see how to create new rules.