Clear all

[Solved] Menu Options Using Multiple Modules

1 Posts
2 Users
2 Reactions
Topic starter

I have an app with 2 modules. If I set up menu options (UiMetaModel settings) for the same role type in both modules, what should happen?

Will the user see the menu options defined in both modules? Or will one module overwrite the other module?

Also, does the developer need to do anything special in this situation? For example, do we need to set one module as a dependency of the other in the module-descriptor.xml?

1 Answer

For any given role type, the module at the "highest level" in the stack will "win".  So if two modules define a RoleTypeUiConfig for the same role type, then the one that depends on the other will "override" the other one completely.  (They are not merged - they are just replaced.)

As you mentioned, module-descriptor.xml is used to define the module dependencies.

If the modules have no interdependencies, the behavior is non-deterministic and could evaluate to either.  But it would be unusual for two "peer" modules like this to override behavior for the same role type.  To disambiguate, you would either make one depend on the other in module-descriptor.xml, or you could have a "capping module" on top to override and "win".