Extra care must be taken when exporting and importing
metamodels and models containing static ports. If the target repository was
created by copying it with the metamodel, MEC
or
MET
import will not update the existing ports but rather
create new ones. This is in accordance with the import of other instances:
importing an instance will create a new instance, unless that instance has
previously been imported into the target repository from the same source
repository.
If new ports are created in the metamodel on import, you
will notice that existing models now show all roles connecting to the default
connectable, rather than to the port connectables. This is because the metamodel
update has created new ports in the metamodel symbols, but the existing models
still use the old ports; when they look up their old ports in the symbols, they
no longer find them, so the roles are drawn to the default connectable. (Note
that MXM
and MXT
import will always
create new instances: importing MXM will thus create graphs whose roles point to
the default connectable; importing MXT will cause all existing graphs’
roles to point to the default connectable.)
Doing it this way ensures
that later metamodel updates will update the existing static ports, rather than
creating new ones. It is also possible for the metamodeler to perform step 2 in
advance for new modelers, and then distribute the resulting repository to them
as their starting point.