Issue
The IsInDevelopment Java action from the Community Commons returns false in licensed Mendix Cloud environments regardless of whether the environment mode is Test, Acceptance, or Production.
Environment
- Applications hosted in Mendix Cloud
- Community Commons (all versions)
Cause
The IsInDevelopment Java action calls Core.getConfiguration().isInDevelopment() . It returns whether this runtime server is running in development mode, which is determined from the DTAPMode runtime setting.
For licensed Mendix Cloud environments, it's expected that this always returns false. It is only set to true for Sandbox environments. There is no custom runtime setting available to override this behavior and make isInDevelopment() return true in a licensed cloud environment.
Solution / Workaround
To distinguish between Test, Acceptance, and Production environments, use the Deploy API instead. The Deploy API returns the following fields per environment:
-
Mode(String): The mode of the environment. Possible values:Test,Acceptance,Production, or the name of a flexible environment. -
Production(Boolean): Indicates whether the environment is flagged as a production environment.
Use the Mode field from the Deploy API response to implement environment-specific logic within the application.
Internal information related
- 118776, 277090
- CUUNVHS9M/p1777362358357489
Additional information
Mendix documentation:
0 Comments