How to: Integrate UML Models with Other Models and Tools
UML models can be integrated with other models and with domain-specific languages.
You can integrate models in the following ways by writing extension code to perform a variety of functions:
Please see the code sample Link UML Elements to Diagrams or other Files. The sample lets users drag a file onto any UML element, and later open the file by double-clicking the element. For example, you could link an activity diagram to a use case element. An icon shows which elements have links.
This code sample demonstrates the following techniques:
-
How to: Attach Reference Strings to Model Elements
The sample code stores file paths and element GUIDs in reference strings that are associated with the element.
-
How to add decorators to UML elements. For general information about decorators, see Customizing Text and Image Fields.
The sample adds an image decorator to the UML shapes.
-
How to: Respond to Changes in a UML Model
The sample demonstrates how to define a rule that responds to new shapes appearing on a diagram.
-
How to: Define a Menu Command on a Modeling Diagram
-
How to: Define a Drop and Double-Click Handler on a Modeling Diagram
The sample demonstrates how to handle items dragged from Windows Explorer, Solution Explorer, and other UML elements.
For an example in which a UML model is be read by a DSL, see How to: Add a Drag-and-Drop Handler.