Rule Result

Rule results in Nected define the output of a rule based on its evaluation. They are fundamental for translating the rules' logic into actionable data that can be used within the application. Rule results determine the type of data returned—such as Boolean, Numeric, String, Date, JSON, or a Custom JavaScript Formula—allowing for a wide range of responses tailored to specific business needs or application requirements.

The purpose of rule results is to provide a clear, dynamic, and context-specific output that can be integrated into the broader application ecosystem. Whether it's triggering specific actions, influencing user interfaces, or driving decision-making processes, rule results enable customizable and scalable responses based on user-defined conditions.

Rule Result is available for only SimpleRule & DecisionTable. It is not available in the Ruleset.

You can define output based on matching conditions as per each rule.

When you add data, you specify the type of result you expect from the rule. Nected offers various result data types, including boolean, numeric, string, date, JSON, and custom JavaScript formulas. The choice of data type depends on the nature of the rule and the desired outcome. Here are the types of data you can add

Nected supports the following six types of output data and results:

  1. Boolean: Use the Boolean type for rule results that require a binary outcome, such as "true" or "false." This type is suitable for decision-making scenarios where the rule needs to confirm or deny a condition based on its evaluation. Like, a rule that checks if a user's input meets certain criteria (e.g., password strength) can return true if the criteria are met and false otherwise.

  2. Numeric: The Numeric type handles numbers, including integers and decimals. It is useful for rules that need to calculate values or assess numerical conditions. As a rule, calculating a discount based on purchase volume would use a numeric result to specify the percentage of the discount.

  3. String: The String type allows for returning textual data. This type is versatile and can be used in various contexts, such as generating status messages or labels based on rule evaluation. A rule determining a user’s membership level could return strings like "Gold," "Silver," or "Bronze."

  4. Date: Use the Date type for rules that operate based on specific dates. This type is crucial for scenarios where the outcome depends on time-sensitive conditions. A rule that checks whether a promotional offer has expired might return the expiration date of the offer.

  5. JSON: The JSON type is used to return structured data. This format is ideal for complex information that involves multiple levels of detail, which can be consumed by UI elements or other applications. A rule could return a JSON object containing customized user profile information, which a client application can then render accordingly.

  6. Custom JavaScript Formula: This type allows users to write custom JavaScript to compute or derive specific outputs. It supports dynamic and complex data manipulations and can utilize various attributes as inputs. A rule could use a custom JavaScript formula to calculate a risk score based on multiple attributes like age, transaction history, and account balance. You can write any Javascript code using input attributes, global attributes, system attributes as well as dataset attributes as tokens.

Result token inside Other Results & Actions

Any result would be available as token in the result defined after that result, with the name .outputdata

Note: The result would be available as a token only in the results defined after this result. The current result key token would not be available in any of the conditions as well as any of the results defined before this result key.

Last updated