Mx Model Reflection
Introduction
The Mx Model Reflection module allows you to access information about the domain model and about microflows of your app from your app. For example, you can loop through all the attribute names of an entity type in a microflow.
Dependencies
The Mx Model Reflection module has the following dependencies:
React Readiness
Versions 8.0.3 and above of the module are compatible with the Mendix React Client. For backwards compatibility, the select pages are still available inside the _USE_ME > _DEPRECATED > ModelInformationSelectPages folder. Those select pages are not used by the module anymore. When the React client is enabled, these pages should be removed.
Typical Use Cases
The typical usage scenario is selecting and showing entities from your domain model to use for another configuration.
Configuration
After importing the module, add _USE_ME > MxObjects to one of your pages (you can directly use _USE_ME > MxObjects_Overview which contains MxObjects, and add the page to the navigation of your app). Run your application for the synchronization. You are able to enable synchronization for each module. For both security and performance purposes, you do not want your entire domain model structure available in your app.
If you want the synchronization to get triggered automatically after your app starts up, use the microflow ASu_CheckMetamodel from the Private > Event flows folder as your after startup microflow, or make sure this microflow gets triggered from your own after startup microflow.
Token Configuration
The display pattern in the token is optional. If you do not specify a value, the module will use the original behavior.
For attributes of the decimal type, the display pattern DecimalFormat
is used (for more information, see Class DecimalFormat).
For dates, the SimpleDateFormat
is used (for more information, see Class SimpleDateFormat).
For all other attributes, the functions from java.util.Formatter are used (for details on the patterns, see Class Formatter).
All the patterns use the locale from the context. Based on the user’s language, the pattern will change its behavior if necessary.
Display Pattern Example (Using En_US Language)
- Long attribute with a thousand separator:
- Pattern:
%,8d%n
- Value:
12345678
- Result:
12,345,678
with a newline character at the end of the string
- Pattern:
- Date attribute:
- Pattern:
MM/dd/yyyy
- Value:
2nd of July 2016
- Result:
07/02/2016
- Pattern:
- Decimal attribute with a thousand separator and one decimal place:
- Pattern:
#,##0.0
- Value:
12345.678
- Result:
12,345.7
- Pattern:
Troubleshooting
Error Message: Set On Click Action to “Do Nothing”
You get the following error:
- “On click action must be set to “Do nothing” when “Selection” is enabled”
Cause
You have an older version of the Data Widgets module.
Solution
Update the “Data Widgets” module to latest version then re-import Mx Model Reflection.