AI Smart Mock Data Generator

Content Type: Module
Categories: Utility,Data,Artificial Intelligence

Overview

Accelerate your development cycle with intelligent data seeding.

 

The AI Smart Mock Data Generator creates realistic, context-aware test data for your Mendix applications instantly. Unlike standard scripts that produce repetitive or static data, this module leverages Generative AI (Google Gemini, OpenAI) to understand your specific requirements and generate high-quality datasets.

 

Key Features

Smart Generation: Creates logical and diverse data profiles (e.g., specific job titles, culturally accurate names, consistent financial data).

Relational Consistency: Capable of generating interconnected data across multiple entities (e.g., Employee -> Job Info -> Finance) while maintaining logical links.

Schema Agnostic: Powered by the Mendix Reflection API (Core API), it works dynamically with any entity in your domain model without requiring manual mapping.

Bulk Creation: Generate hundreds of records in seconds with a single prompt.

 

Why use this module?

  • Stop wasting time writing manual SQL scripts or Excel sheets.
  • Test your UI with real-looking data lengths and formats.
  • Demo your apps to clients with professional, readable content instead of "test1", "test2".

 

Current Version: Supports Google Gemini and OpenAI models.

Documentation

https://youtu.be/IK7rW3ZtZe8

Typical usage scenario

AI Mock Data Generator helps Mendix developers quickly populate their domain models with realistic test data using AI. Instead of manually creating test records or writing complex random data generators, simply point to your entity and let AI generate contextually appropriate mock data.

 

Common use cases:

  • Development & Testing: Quickly populate your app with realistic data during development.
  • Demo Environments: Generate professional-looking sample data for client demos (e.g., "Medical Records", "CRM Leads").
  • Load Testing: Create large datasets to test application performance.
  • Training Environments: Populate sandbox environments with realistic but fake data for user training.

 

Features and Limitations

Features:

  • ✅ Secure API Key Management: Built-in dashboard to securely store and encrypt API keys using the Mendix Encryption module.
  • ✅ Multi-Provider Support: Seamlessly switch between Google Gemini and OpenAI (GPT-4o) models.
  • ✅ Smart Generation: Supports all common Mendix attribute types (String, Integer, Long, Decimal, Boolean, DateTime, Enum).
  • ✅ Enum Awareness: Automatically detects and respects your defined Enum values.
  • ✅ Context-Aware: Give hints like "Turkish customers" or "Tech startup employees" to get relevant data.
  • ✅ Bulk Generation: Generate multiple objects in a single API call for efficiency.

 

Limitations:

  • ❌ Does not generate data for associations/relationships (only primitive attributes).
  • ❌ AutoNumber, Binary, and HashedString attributes are automatically skipped.
  • ❌ Requires a valid external API key (Gemini or OpenAI).

 

Dependencies

  • Mendix Studio Pro 10.0.0 or higher.
  • Encryption Module: This module depends on the standard Mendix Encryption module to secure your API keys.

 

Installation

  1. Download the module from Mendix Marketplace.
  2. Download the required Encryption module if not already present.
  3. Navigation: Add the APIKey_Overview page to your application's navigation or administration menu to manage your AI keys.
  4. Security: Ensure the Administrator or relevant user role has access to the module roles.

 

Configuration & Security (API Key Management)

This module includes a secure, built-in system to manage your AI provider keys. You do not need to hardcode keys or use Constants.

1. Managing Keys:

  • Navigate to the API Key Overview page.
  • Click New to add a provider key (Gemini or OpenAI).
  • Encryption: The key is automatically encrypted before being saved to the database using the Mendix Encryption module.
  • Security: To ensure security, keys are immutable. You cannot edit a key after creation; you can only delete it and create a new one.

2. Retrieving Keys in Logic:

  • The module enforces Owner-based Access. Only the user who created the key can retrieve it.
  • Use the provided microflow SUB_APIKey_Get in your logic.
  • Input: Pass the Title (String) of the key you defined.
  • Output: The microflow checks ownership, decrypts the key, and returns it as a String (or empty if not found/unauthorized).

 

⚠️ Note on Flexibility: Using the built-in API Key manager is optional. If your application already has a centralized secret management system (e.g., AWS Secrets Manager, custom entities, or environmental variables), you can bypass the APIKey_Overview page entirely. Simply pass your retrieved API Key string directly to the ApiKey parameter in the Java Actions.

 

How to Use (Java Actions)

Use the included Java Actions in your microflows to generate data:

  • JA_GenerateMockData: Generate a single object.
  • JA_GenerateMockData_List: Generate a list of objects.

Parameters:

  • Entity: Full entity name (e.g., MyModule.Customer).
  • GenerationContext: Optional hint for AI (e.g., "Turkish names, corporate emails").
  • ApiKey: The decrypted API key string (retrieve this using SUB_APIKey_Get).
  • Model: Select the AI model compatible with your key (e.g., gemini-2.0-flash for Google, gpt-4o for OpenAI).
  • ExcludedAttrs: Comma-separated list of attributes to skip (e.g., "Password, SSN").
  • Count: Number of objects to generate (List action only).

Note: The actions return uncommitted objects. You must use a Commit action in your microflow to persist them.

Frequently Asked Questions

 

Q: Is my API Key safe?

A: Yes. Keys are encrypted in the database using the standard Mendix Encryption module. Additionally, the retrieval logic prevents other users from accessing keys they did not create.

Q: Which AI model should I use?

A: For most cases, gemini-2.0-flash offers the best balance of speed, cost (free tier available), and quality. Use gpt-4o-mini if you prefer OpenAI ecosystem.

Q: Can I generate related objects (associations)?

A: Not directly within the Java Action. However, you can build a microflow loop to generate parent objects first, then generate child objects using the parent's data as context (see the demo video for an example).

Releases