Defining Swimlane Maps

Swimlanes are horizontal or vertical lines that partition the diagram into sections. For example, the DSL Definition diagram in the Domain-Specific Language Tools solution templates is divided by a swimlane into a section for domain classes and domain relationships, and another section for diagram elements. 

Defining Swimlane Maps

Swimlanes are typically mapped to a domain class. For example, in the Task Flow solution template, the ActorSwimlane is mapped to the Actor domain class. If you add a swimlane to a diagram, set its parent element path to the domain class that is represented by the diagram.

Set the parent element paths of shapes in a swimlane to the domain class that is represented by the swimlane rather than to the domain class that is represented by the diagram. By ensuring that shapes are contained in the swimlane, you also ensure that the shapes will move together with the swimlane if it is moved.

To define mapping for a swimlane

  1. Create a model that has three domain classes and name them ModelClass, SwimlaneClass, and FirstClass.

  2. ModelClass is the root of the model. Create an embedding relationship between ModelClass and SwimlaneClass.

  3. Create an embedding relationship between SwimlaneClass and FirstClass.

  4. Map ModelClass to the diagram.

  5. Add a swimlane and map SwimlaneClass to it.

  6. Add a geometry shape and map FirstClass to it.

    For more information about how to map domain classes to shapes, see Defining Shape Maps.

  7. Because the FirstClass domain class has SwimlaneClass as a parent, the Parent element path setting for the mappings should be SwimlaneClassHasFirstClasses.SwimlaneClass/!SwimlaneClass.

  8. You must add Toolbox items for the swimlane and the domain classes before a user of your domain-specific language designer can add them to the diagram. For information about how to add items to the Toolbox, see Customizing Tools and the Toolbox.

See Also

Other Resources

Domain-Specific Language Tools Glossary

Change History

Date

History

Reason

July 2008

Rewrote and refactored project.

Content bug fix.