Show in Frame No Frame
Up Previous Next Title Page Index Contents Search

2.4.4 Exporting/importing with static ports

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.)

For safe importing of static ports, follow these instructions:
1)When the initial version of the metamodel is ready, export it as a binary patch file, giving a unique, permanent repository name when requested (e.g. MyCompanyMyProject)
2)The modeler creates an empty repository, creates a new project and imports the patch file.
3)When a new version of the metamodel is ready, export it again as a patch file, giving exactly the same repository name as in step 1).
4)The modeler imports the new metamodel into his existing repository.

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.

Show in Frame No Frame
Up Previous Next Title Page Index Contents Search