Reading model - Model/diagram element

<MetaModelElement>

Description

<MetaModelElement> is a construct which enables you to retrieve a model element from another model element.

Attributes

Name Description/Usage Required?
modelProperty : string The name of property to query from model element, which should result in returning a model element from the given model element.
Optional
Supported attributes for <MetaModelElement>

Sample template fragment

<Template>
    <TemplateInformationHeader name = "Tagged values" description = "/" type = "text" default = "false"/>
    <ElementBaseInitiationBlock>
        <MetaModelElement modelProperty = "taggedValues">
            <IterationBlock>
                <StringPropertyText propertyText = "name"/>
            </ IterationBlock >
        </MetaModelElement>
    </ElementBaseInitiationBlock>
</Template>

<FromEnd>

Description

<FromEnd> is a construct for retrieving the from-side of a relationship. Here are some of the key points you need to know when using <FromEnd> in your template:

  • The from-end of relationship is determined by the side a connector (shape) begins with. It has nothing related to the semantic or definition of notation. Take generalization as example, the from-side is the side with arrow head (unless you have configured the beginning of generalization in Options window).
  • When you try to retrieve the from-end of an association, you are retrieving the connected element (e.g. a class, a use case) instead of a role. If you need to retrieve a role, use <ForEachRelationshipEnd>

Sample template fragment

<Template>
    <TemplateInformationHeader name = "Associations and Generalizations" description = "/" type = "text" default = "false"/>
    <ElementBaseInitiationBlock>
        <!-- Print from ends of associations -->
        <ForEachRelationshipEnd type = "AssociationEnd" endPointer = "self">
            <RelationshipEndEndRelationship>
                <FromEnd>
                    <StringPropertyText propertyText = "name"/>
                </FromEnd>
            </RelationshipEndEndRelationship>
        </ForEachRelationshipEnd>

        <!-- Print from ends of generalizations -->
        <ForEachSimpleRelationship type = "Generalization" direction = "all">
            <FromEnd>
                <StringPropertyText propertyText = "name"/>
            </FromEnd>
        </ForEachRelationshipEnd>

    </ElementBaseInitiationBlock>
</Template>

<ToEnd>

Description

<ToEnd> is a construct for retrieving the to-side of a relationship. Here are some of the key points you need to know when using <ToEnd> in your template:

  • The to-end of relationship is determined by the side a connector (shape) begins with. It has nothing related to the semantic or definition of notation. Take generalization as example, the to-side is the side without arrow head (unless you have configured the beginning of generalization in Options window).
  • When you try to retrieve the to-end of an association, you are retrieving the connected element (e.g. a class, a use case) instead of a role. If you need to retrieve a role, use <ForEachRelationshipEnd> to retrieve the association ends of an elements. The association ends returned is then the roles.

Sample template fragment

<Template>
    <TemplateInformationHeader name = "Associations and Generalizations" description = "/" type = "text" default = "false"/>
    <ElementBaseInitiationBlock>
        <!-- Print to ends of associations -->
        <ForEachRelationshipEnd type = "AssociationEnd" endPointer = "self">
            <RelationshipEndEndRelationship>
                <ToEnd>
                    <StringPropertyText propertyText = "name"/>
                </ToEnd>
            </RelationshipEndEndRelationship>
        </ForEachRelationshipEnd>

        <!-- Print to ends of generalizations -->
        <ForEachSimpleRelationship type = "Generalization" direction = "all">
            <ToEnd>
                <StringPropertyText propertyText = "name"/>
            </ToEnd>
        </ForEachRelationshipEnd>

    </ElementBaseInitiationBlock>
</Template>

<RelationshipEndEndRelationship>

Description

<RelationshipEndEndRelationship> is a construct for retrieving relationship from a relationship end (e.g. association end). Note that <RelationshipEndEndRelationship> has no effect with <FromEnd> and <ToEnd>.

Sample template fragment

<Template>
    <TemplateInformationHeader name = "Associations" description = "/" type = "text" default = "false"/>
    <ElementBaseInitiationBlock>
        <!-- Print to ends of associations -->
        <ForEachRelationshipEnd type = "AssociationEnd" endPointer = "self">
            <RelationshipEndEndRelationship>
                <ToEnd>
                    <StringPropertyText propertyText = "name"/>
                </ToEnd>
            </RelationshipEndEndRelationship>
        </ForEachRelationshipEnd>
    </ElementBaseInitiationBlock>
</Template>

<RelationshipEndOppositeEnd>

Description

<RelationshipEndOppositeEnd> is a construct for retrieving the opposite end of a relationship end (e.g. association end). Note that <RelationshipEndOppositeEnd> has no effect with <FromEnd> and <ToEnd>.

Sample template fragment

<Template>
    <TemplateInformationHeader name = "Associations" description = "/" type = "text" default = "false"/>
    <ElementBaseInitiationBlock>
        <ForEachRelationshipEnd type = "Print myself" endPointer = "self">
            <RelationshipEndOppositeEnd>
                <MetaModelElement property="EndModelElement">
                    <StringPropertyText propertyText = "name"/>
                </ MetaModelElement>
            </RelationshipEndOppositeEnd>
        </ForEachRelationshipEnd>
    </ElementBaseInitiationBlock>
</Template>

<ParentModel>

Description

<ParentModel> is a construct for retrieving the parent model element that contains a model element. For example, retrieve the package of a class.

Attributes

Name Description/Usage Required?
modelProperty : string The type of parent model element you want the model element to be/not to be contained by.
Optional
Supported attributes for <ParentModel>

Sample template fragment

<Template>
    <TemplateInformationHeader name = "Parent" description = "/" type = "text" default = "false"/>
    <ElementBaseInitiationBlock>
        <ParentModel>
            <StringPropertyText propertyText = "name"/>
        </ParentModel>
    </ElementBaseInitiationBlock>
</Template>

<DiagramProperty>

Description

<DiagramProperty> is a construct for retrieving a diagram from property. For example, retrieve embedded process diagram of a BPMN sub-process. Note that <DiagramProperty> is not for retrieving sub-diagrams. If you want to retrieve sub-diagrams, use <ForEachSubDiagram> instead.

Attributes

Name Description/Usage Required?
property : string The name of diagram property to retrieve from model element.
Required
Supported attributes for <DiagramProperty>

Sample template fragment

<Template>
    <TemplateInformationHeader name = "Diagram name of analysis diagram" description = "/" type = "text" default = "false"/>
    <DiagramBaseInitiationBlock>
        <IterationBlock elementType="AnalysisDiagramNode">
            <DiagramProperty property="analysisDiagramId">
                <StringPropertyText property="name"/>
            </DiagramProperty>
        </IterationBlock>
    </DiagramBaseInitiationBlock>
</Template>

<OwnerDiagram>

Description

<OwnerDiagram> is a construct that enables you to retrieve the diagram where a diagram element exists.

Sample template fragment

<Template>
    <TemplateInformationHeader name = "Diagram name of analysis diagram node" description = "/" type = "text" default = "false"/>
    <DiagramBaseInitiationBlock>
        <IterationBlock elementType="AnalysisViewNode">
            <DiagramElementProperty property="analysisViewId">
                <OwnerDiagram>
                    <StringPropertyText property="name"/>
                </OwnerDiagram>
            </ DiagramElementProperty >
        </IterationBlock>
    </DiagramBaseInitiationBlock>
</Template>

<ElementImage>

Description

<ElementImage> is a construct for printing an image of diagram or diagram element, or icon for model type.

Attributes

Name Description/Usage Required?
imageType : string = icon

{diagram | icon}
Specify the type of image.

diagram – image for diagram/diagram element
icon – icon for model type
Optional
imageFormat = png

{png | jpg | wmf}
The image format (png/jpg/wmf) of the image to present. Optional
alignment = left

{left | center | right}
The position of image – left/center/right. Optional
width : integer Restrict the image to specific width. Optional
height : integer Restrict the image to specific height. Optional
maxWidth : integer Set the maximum width of image. Optional
maxHeight : integer Set the maximum height of image. Optional
landscape : boolean = false Adjust the orientation of image. True for landscape. False for portrait. Optional
Supported attributes for <ElementImage>

Sample template fragment

<Template>
    <TemplateInformationHeader name = "Class diagrams in project" description = "/" type = "text" default = "false"/>
    <ProjectBaseInitiationBlock>
        <ForEachDiagram diagramType="ClassDiagram">
            <ElementImage imageType="diagram"/>
        </ForEachDiagram>
    </ProjectBaseInitiationBlock>
</Template>

 

Related Resources

The following resources may help you learn more about the topic discussed in this page.

 
5. Reading model - Conditional checking Table of Contents 7. Text and break
 

Technical Support

Have technical issues or suggestions? Please contact Visual Paradigm Support Team.

Sales Support

Have questions related to registration, licensing or payment? Feel free to contact Visual Paradigm Sales Team.

Discussion Forum

Share your suggestions of opinions at VP Discussion Forum.