Share via


How to: Map Elements By Using the Diagram Element Map Tool

The Domain-Specific Language Designer includes a Diagram Element Map tool in the Toolbox. By using this item, you can map domain classes, named domain classes, and domain relationships to shapes and specify how those classes and relationships appear in a generated designer.

The following procedures demonstrate how to map a domain class to a shape and how to map a domain relationship to a connector. After you have established a mapping, you can define its details in the DSL Details window. For more information, see Defining Element Mapping Details. You can also map elements in DSL Explorer. For more information, see How to: Add a Connector Map (DSL Explorer), How to: Add a Compartment Shape Map (DSL Explorer), How to: Add a Shape Map (DSL Explorer), and How to: Add a Swimlane Map (DSL Explorer).

Note

If you do not have a diagram assigned to your domain-specific language project, the Diagram Element Map tool will not map your elements. To add a diagram, see How to: Add a Diagram (DSL Explorer).

To map a domain class to a shape

  1. In the Toolbox, on the DSL Designer tab, click Diagram Element Map.

    When you point to an element in the diagram that you can map, the pointer changes to the mapping tool icon. Otherwise, the pointer appears as a no-drop icon.

  2. In the Classes and Relationships swimlane, click the domain class that you want to map to a shape. For more information about domain classes, see How to: Add a Domain Class to a Domain-Specific Language Definition and How to: Add a Named Domain Class to a Domain-Specific Language Definition.

  3. In the Diagram Elements swimlane, click the shape to which you want to map the domain class.

    A map line appears on the diagram between the domain class and the shape. For more information about the different shapes that are available, see Element Reference for Domain-Specific Languages.

    Note

    You can show or hide the mapping lines on the diagram by clicking Show Map Lines on the toolbar for the Domain-Specific Language Designer. For more information, see How to: Organize a Domain-Specific Language Diagram.

  4. Click the map line that you just established, and configure mapping details in the DSL Details window. For more information, see Defining Element Mapping Details.

    Note

    If the DSL Details window is not visible, click DSL Details on the toolbar for the Domain-Specific Language Designer.

To map a domain relationship to a connector

  1. In the Toolbox, on the DSL Designer tab, click Diagram Element Map.

    When you point to an element in the diagram that you can map, the pointer changes to the mapping tool icon. Otherwise, the pointer appears as a no-drop icon.

  2. In the Classes and Relationships swimlane, click the domain relationship that you want to map to a connector. For more information about domain relationships, see How to: Add an Embedding Relationship to a Domain-Specific Language Definition and How to: Add a Reference Relationship to a Domain-Specific Language Definition.

  3. In the Diagram Elements swimlane, click on the connector shape to which you want to map the domain class. For more information, see How to: Add a Connector to a Domain-Specific Language Definition.

    A map line appears on the diagram between the domain relationship and the connector.

    Note

    You can show or hide the mapping lines on the diagram by clicking Show Map Lines on the toolbar for the Domain-Specific Language Designer. For more information, see How to: Organize a Domain-Specific Language Diagram.

  4. Click the map line that you just established, and configure mapping details in the DSL Details window. For more information, see Defining Element Mapping Details.

    Note

    If the DSL Details window is not visible, click DSL Details on the toolbar for the Domain-Specific Language Designer.

See Also

Concepts

Working with the Domain-Specific Language Designer

Domain-Specific Language Tools Glossary