Feature Toggle Extension

Content Type: Module
Categories: Utility,Scheduling

Overview

The Mendix Feature Toggle Extension Module provides a crucial framework for managing the release and visibility of new or in-progress application features without requiring new deployments.

Purpose (Why use this module?)

The core purpose of this module is to decouple feature deployment from feature release.

In modern Mendix development, teams strive for Continuous Integration/Continuous Delivery (CI/CD), meaning code is deployed frequently. However, frequently deployed code often includes large, incomplete, or experimental features that are not yet ready for end-users. This module solves that conflict.

 

By using a feature toggle, developers can:

  1. Keep Delivering: Continuously push new code, including unfinished functionality, into test, acceptance, and even production environments.
  2. Maintain Stability: Block or "hide" the unfinished features, ensuring the public users or stakeholders only see fully tested, stable functionality.
  3. Decouple Release: Launch the feature instantly, without any downtime or code redeployment, by simply flipping the feature toggle switch via the configuration UI.

 

This approach significantly reduces risk, enables A/B testing scenarios, and allows business stakeholders to control the precise moment a new capability goes live.

 

Core Use Case (How is the module used?)

The module’s use case revolves around granting granular control over access:

  1. Developer Implementation: A developer integrates the feature checks into the application logic using the provided Rules and Microflows (e.g., Feature_Enabled). This logic determines if a button, page, or microflow should execute.
  2. Unlimited Features: The developer can register an unlimited number of features.
  3. Configuration Control: An administrator or stakeholder uses the provided configuration options to manage access:
    • Global Level: The feature is toggled ON or OFF for everyone.
    • User Role Level: The feature is only enabled for specific roles (e.g., only Managers see the new functionality in Acceptance).
    • User Level: The feature is enabled only for specific individuals (e.g., a Key User for early access).
  4. Advanced Management: The module includes settings for Migration Triggering (running cleanup/setup microflows when a feature is switched) and Preventing Global Rollback (locking a feature ON to avoid data integrity issues).

 

The combination of runtime control and granular access makes this module essential for any medium-to-large Mendix application pursuing advanced release strategies.

 

Documentation

Typical usage scenario

The primary use case for this module is to decouple the deployment of new features from their release to end-users.

 

When developing a medium or large piece of new functionality, a feature toggle allows development teams to "hide" or block this functionality until it is fully finished and tested. This is useful because it allows the development team to keep delivering functionalities into test and acceptance environments without the public using the new features straight away.

 

The core benefit is the ability to launch features instantly, without the requirement of a new application deployment, simply by updating the feature configuration at runtime. This practice reduces deployment risk and enables controlled, real-time feature releases.

 

Features and limitations

The module provides robust functionality for controlling feature visibility and managing feature lifecycle events.

 

Configuration Options (For Administrators/Stakeholders):

  • Granular Access Control:
    • Enable and disable features at a global level (application-wide).
    • Enable and disable features at a user role level (role-based access).
    • Enable and disable features at an individual user level (user-specific override).
  • Advanced State Management:
    • Migration Triggering: Trigger a developer-defined microflow when a feature is switched on or off. This action can be configured to run based on a change at the global, user role, or individual user level.
    • Default Values: Set default access values (Enabled/Disabled) for new features at the global, user role, and individual user levels upon creation.
    • Prevent Global Rollback: Configure specific features to be prevented from switching back to the default value (switching OFF) after being switched ON globally. This is critical in cases where switching a feature off after initial enablement might lead to data integrity issues.

 

Developer Implementation Tools:

  • Unlimited Features: Add and register an unlimited amount of features within the application.
  • Access Checks: Use provided Rules and Microflows to programmatically test feature enablement:
    • Test if the feature is enabled for the current user.
    • Test if the feature is enabled for a specific user (allowing checks against non-current users).

 

Dependencies

Feature Toggle module (Required)

 

Installation

  1. Ensure the Feature Toggle module is installed in your Mendix application.
  2. Import the Feature Toggle Extension Module into your application via the Mendix Marketplace.

 

Configuration

  1. Define Features: Register new features using the provided administration pages.
  2. Set Defaults: Configure the default global, role, and user access settings for new features.
  3. Implement Checks: Integrate the provided Rules and Microflows (e.g., RULE_Feature_Enabled_ForCurrentUser) into your application logic (e.g., page visibility conditions, button click microflows).
  4. Configure Migrations: If required, specify microflows to be executed when the feature state is changed (ON/OFF) at the global, role, or user level.

 

Frequently Asked Questions

Q: Can I use this module to control access to features in different environments (e.g., Test vs. Production)?

A: Yes. The configuration is stored in the database, allowing you to maintain different feature states across your environments (e.g., fully enabled in Test, but globally disabled in Production).

 

Q: If a feature is globally disabled, but enabled for a specific user, what takes precedence?

A: The feature logic is designed to follow a hierarchy: Individual User settings typically override User Role settings, which typically override Global settings. The default check microflows will evaluate the most specific configuration applicable to the user.

 

Releases

Version: 11.1.0
Framework Version: 11.6.0
Release Notes:

Initial Mendix 11 release

Version: 10.1.0
Framework Version: 10.24.0
Release Notes:

Initial Mendix 10 release

Version: 9.1.0
Framework Version: 9.24.0
Release Notes:

Updated version numbers to align with Mendix versioning and support multiple Mendix versions

Version: 1.0.0
Framework Version: 9.24.0
Release Notes:

Initial release of the Feature Toggle module