Importing elements from UML models into topologies

You can import elements from a UML model into a topology. The topology editor creates units that are bound to the UML elements.

About this task

You can import these types of UML element into a topology:
  • Actors
  • Components
  • Nodes
When you import two or more elements from the same model, the topology editor creates application communication constraint links to match static links between those units in the UML model. Also, the topology editor ensures that these links remain in the topology by verifying that the topology units are linked in the same way that the UML elements to which they are bound are linked. The following types of links in the UML model result in links in the topology, regardless of any stereotype on the links:
  • Information flow links
  • Component realization links
  • Usage links
  • Abstraction links
  • Generalization links
  • Dependency links

Procedure

To import elements from UML models:

  1. If the UML model is not expanded in the Project Explorer view, expand the UML model by clicking the plus sign (+) next to its name.
  2. Drag the UML element from the model in the Project Explorer view to a diagram in the topology editor.
  3. If the unit already exists in the topology, a message appears that prompts you to either create a new view of the existing unit or to create an additional unit from the same element.

Results

The UML element is represented in the topology as a unit of the related type.
Importing UML elements into a topology
The new unit has these characteristics:
  • The new unit has the same name as the UML element, except that the first letter of the name is changed to lower case. Also, if you create multiple units from the same element, the name is qualified with a number at the end.
  • The unit is marked as bound, which indicates its relationship to the UML element. The details of the binding (that is, the location of the UML model and the name of the corresponding UML component) are listed in an artifact on the unit.
  • If you dragged a UML component with deployment units, the topology editor automatically imports the deployment units along with the component. You cannot import the deployment units directly. For more information on importing deployment units, see Modeling the run-time organization of an application with deployment units.
  • If the UML element had a stereotype, that stereotype is reflected as a stereotype on the unit. The profile name of the stereotype and whether the stereotype is required are also indicated on the new unit. As with the links, the topology editor ensures that the stereotypes remain on the unit by comparing the unit with the UML element to which it is bound.
  • If the corresponding UML element is deleted from the UML model, the topology editor prompts you to remove the unit from the topology. If you want to retain the unit in the topology even though the corresponding UML element is gone, you can manually delete the artifact that links the unit to the UML element.

After you have imported UML elements into a topology, you can use UML diagrams to make sure that the units are linked in the same way as the elements are. See Using UML interactions as constraints in topologies.


Feedback