1. Home
  2. Sample Projects
  3. Model Improvement Recommendation

Model Improvement Recommendation

◷ Reading Time: 6 minutes

This sample project demonstrates how to automate error analysis, categorization, and escalation with recommendations by using FlexRule’s Decision Automation capabilities. The scenario is based on processing error logs within a database table and notifying responsible parties with recommendations.

Scenario Overview

Organizations often face a large volume of system error logs, which is hard to analyze and take action on manually. In this scenario, users can define a date range as input, extract relevant stack traces from a database table, categorize errors, assess severity, assign recommendations, and then send suggestions to the appropriate teams.

Solution

Step 1: Data Extraction

  • Inputs: A user provides a date range (from – to) as an input to the model.
  • Action: The database node executes a SQL query to retrieve all matching stack traces as a list from the ServiceErrors table, each containing a detailed error message.
Value_ Stacktrace

Step 2: Initial Error Categorization 

During this step, the stack trace list is passed to a Decision Table that iterates through the list by:

  • Looking at the value (the stacktrace message) for special keywords or patterns that are tied to each error category (such as terms like “DB connection” for Database_Issue or “null reference” for Model_Issue).
  • If a stack trace contains any of the category’s keywords, it is categorized accordingly.
  • The function used in the expression, created in a separate was Business Formula
  • If no matching keywords are found in the stack trace, it is assigned the default category of Other_Issue.
  • Then an output object is created for each error with:
    • value: the stack trace
    • type: assigned error category
Error Categorization Decision Table

The result object is as follows at the end of this step.

Error Category Output

Step 3: Grouping and Counting Errors

In this step, errors are grouped by Error Type, and then for each type, an object is created with:

  • ErrorList: all stack traces of that category
  • ErrorCount: the number of errors in the group
  • Category: error type
Group by Error types

The ErrorGroups collection is as follows at the end of this step.

Error Groups

Step 4: Severity Level and Recommendations

  • A second Decision Table iterates over each grouped error object.
  • Based on the Category and ErrorCount, it determines:
    • Severity (High, Medium, Low)
    • Recommendation (e.g., Contact Database Admin, Monitor logs)
  • It also enriched the ErrorGroup object, which contains:
    • ErrorListErrorCountCategorySeverity, and Recommendation.
Error Severity and recommendation

Example Output Structure:

Severity and recommendation

Step 5: Automated Email Notifications

  • The resulting ErrorGroups collection is used to generate notification emails.
  • In the Email Notification node, you can use parameterized values to create dynamic email content in HTML format. And also multiple recipients.
  • The relevant party receives an email with details and recommendations for the specific error category.

Sample Email:

Sample Email for generated Error recommendation

Step 5: Final Model

We can combine these decisions into a Decision Graph with an input node(Date Range) as follows.
Determine Error Category: This decision node has a pre-execution event for database connectivity.
Determine Error Severity and Recommendation: This decision node has post-event execution for the email notification.

Decision Graph for the model improvement

Prerequisites

  1. This sample project requires a local database to run. The database script is attached to the project (Folder called DB).
  2. Once you create the database, you need to update the database connection string according to your database credentials.
  3. To send email notifications, you need to update the email Recipients, server details, and credentials on the post-execution event at the “Determine Error Severity and Recommendation” decision node.
Email settings

How to run the project

Open the file “Determine Model Improvement Recommendation.xml” and use the run template to run the model. Ensure you have all the necessary prerequisites.

Download the project

Use the attachment at the end of the page to download the sample project.

Updated on November 3, 2025

Article Attachments

Was this article helpful?

Related Articles