Element Merge Directives Overview
An element merge directive instructs Domain-Specific Language Tools how to add one element to another. This type of merge action typically occurs when you drag an element off the Toolbox. You create element merge directives by using DSL Explorer. For more information, see How to: Add an Element Merge Directive. In DSL Explorer, you can add element merge directives under the following nodes:
Connectors For more information, see Customizing Connection Builders in Domain-Specific Language Explorer.
Diagram For more information, see Modifying Diagram Settings in Domain-Specific Language Explorer.
Domain Classes For more information, see Defining Domain Classes in Domain-Specific Language Explorer.
Domain Relationships For more information, see Customizing Domain Relationships in Domain-Specific Language Explorer.
Shapes For more information, see Defining Shapes in Domain-Specific Language Explorer.
The element merge directive specifies what links must be created when the merging element is merged into the target element. To understand this behavior, you can examine the element merge directive that is called Comment in the ComponentModel domain class in the Component Models solution template. For more information, see Choosing a Domain-Specific Language Solution Template.
In a domain-specific language that is based on the Component Models solution template, a link of ComponentModelHasComments relationship is created when a Comment domain class is merged onto a ComponentModel domain class. The link list for the element merge directive contains the following domain path:
ComponentModelHasComments.Comments
For more information, see Domain Path Syntax Overview. The domain path for the link appears in the Element Merge Directive Details channel of the DSL Details window. For more information, see How to: Set Element Merge Directive Details.
Not all element merge directives are on the model root. You can drag an attribute or an operation onto a domain class. Therefore, the domain class has an element merge directive for attributes and operations.
For a more complex element merge directive path, see the Task Flow solution template. In this case, you can drag a Comment from the Toolbox onto an Actor, which is represented by a swimlane. However, the constructed link is not from the Actor domain class but from its parent domain class, which is called FlowGraph. Therefore, the path starts by navigating to the parent model, and the last segment specifies the actual link to construct:
FlowGraphHasActors.FlowGraph / ! FlowGraph / FlowGraphHasComments.Comments
In the same domain-specific language, two links are created when you drop a FlowElement onto an Actor. One link connects to the model root, and another connects to the Actor onto which the model root was dropped. Therefore, the element merge directive contains two link paths under Actor for FlowElement.