How to reference entities defined in different domain models

0
How can a domain model (say in module B) use an entity defined by a different domain model (say in module A)? I don’t want to copy/paste the foreign entity from A to B, as this entity is owned by A, and could change, should A change. Obviously there is here a tight dependency of B over A, by design. Is this use case of re-using domain models across modules supported? Thanks in advance!
asked
3 answers
0

Hi Jean Paul,

this behavior is fully supported by Mendix. Within a microflow you can retrieve/create/manipulate any object from any entity in any of your modules (except for some entities in the System module)

It is also possible to associate an entity from module A to an entity in module B with the same capabilities as within the module itself (these are called "cross module associations", see https://docs.mendix.com/studio/domain-models-association-properties)

Regards,

Joost

answered
0

You could either use a reference or use inheritance. Depends a bit on what you want to achieve. With a reference you can set this refernce between entity X in module A towards entity Y in module B. With inheritence you have all the attributes of the entity which you inherit from. Take for instance the filedocument object in the modeler.

Regards,

Ronald

 

answered
0

Many thanks for Ronald and Joost to point me in the right direction: cross-modules associations or inheritance, exactly what is needed!

answered