index > Visual Studio Team System - Domain-Specific Language Tools > TextDecorators in SwimLaneShapes

TextDecorators in SwimLaneShapes


After modifying my dsl-definition I get an error transforming my templates.
I can get rid of the error by deleting the TextDecorator on my SwimLaneShape, adding the decorator reproduces the error.

After playing around with a new model, adding a DomainClass, DomainProperty, SwimLaneShape and TextDecorator I get this same error once I wired the TextDecorator to point at the DomainProperty on DomainClass.

Does anyone have a clue on what might have caused this error? and how to get rid of it? TIA

Error looks like:
Error 1 Running transformation: System.InvalidOperationException: Domain relationship specified domain role belongs to doesn't match the type of link requested.
at Microsoft.VisualStudio.Modeling.RolePlayerLinksCollection.GetLinks[T](DomainRoleInfo domainRole, Boolean excludeDerivedRolesLinks)
at Microsoft.VisualStudio.Modeling.DomainRoleInfo.GetElementLinks[T](ModelElement rolePlayerElement)
at Microsoft.VisualStudio.Modeling.DomainRoleInfo.GetElementLinks[T](ModelElement rolePlayerElement, Guid domainRoleId)
at Microsoft.VisualStudio.TextTemplating1F672FD4B746F2D498A572B1812810D4.GeneratedTextTransformation.GenerateDomainModel(DslLibrary dm)
at Microsoft.VisualStudio.TextTemplating1F672FD4B746F2D498A572B1812810D4.GeneratedTextTransformation.TransformText() C:\Documents and Settings\Olaf Conijn\My Documents\Code\Test\tester\Dsl\GeneratedCode\DomainModel.tt 1 1

The definition for the SwimLaneShape and SwimLaneShapeMap look like the following:

<SwimLane Id="6618d4e7-babb-40a2-993c-af73f794b7a4" Description="Description for OlafConijn.tester.SwimLane1" Name="SwimLane1" DisplayName="Swim Lane1" Namespace="OlafConijn.tester" FixedTooltipText="Swim Lane1" InitialWidth="0" InitialHeight="0">
<Decorators>
<SwimLaneHasDecorators Position="InnerTopLeft" HorizontalOffset="0" VerticalOffset="0">
<TextDecorator Name="TextDecorator1" DisplayName="Text Decorator1" DefaultText="TextDecorator1" />
</SwimLaneHasDecorators>
</Decorators>
</SwimLane>

{....}

<SwimLaneMap>
<DomainClassMoniker Name="ExampleElement" />
<DecoratorMap>
<TextDecoratorMoniker Name="SwimLane1/TextDecorator1" />
<PropertyDisplayed>
<PropertyPath>
<DomainPropertyMoniker Name="ExampleElement/Name" />
</PropertyPath>
</PropertyDisplayed>
</DecoratorMap>
<SwimLane>
<SwimLaneMoniker Name="SwimLane1" />
</SwimLane>
</SwimLaneMap>


OlafC

Is the Name property on ExampleElement or is it in a base class? (If so, the DomainPropertyMoniker should be NamedElement/Name)

If that's not the problem, may we see your ExampleElement defn please?

Thanks




- Alan [Microsoft]
Alan Cameron Wills

Alan - Thanks for your response.

no, I dont believe the problem is the DomainPropertyMoniker.

I deleted the origianal reproduction dsl. but made a new one following these steps:
(I suspect there is some error in the steps I took, since I had this working before!)

1) Create a minimal language (name=TestLanguage, others properties=defualt)
2) Delete Example Shape (in diagram)
3) Add SwimLane1 (from toolbox)

4) DSL explorer -> delete ShapeMap
5) DSL explorer -> add SwimLaneMap
  DomainClass: ExampleElement

6) Save, continue when prompted
7) Open DslDefinition.dsl with xmleditor
8) Modify Diagram/ShapeMaps so that it looks like:

 <ShapeMaps>
      <SwimLaneMap>
        <DomainClassMoniker Name="ExampleElement" />
        <SwimLane>
          <SwimLaneMoniker Name="SwimLane1"/>
        </SwimLane>
      </SwimLaneMap>
    </ShapeMaps>


<<Back to the Dsl-editor>>
9) DSL Explorer -> Add TextDecorator1 to SwimLane1
10) DSL Explorer -> Select SwimLaneMap -> DSL Details, Decorator Maps -> Check TextDecorator1, Display Property = "Name"

Save the lot.
Transform all templates.
<error occurs>


The ExampleElement is defined as follows:

<DomainClass Id="d85a8bb1-349a-4893-9856-e76540d9b1bb" Description="Description for OlafConijnConsulting.TestLanguage.ExampleElement" Name="ExampleElement" DisplayName="Example Element" Namespace="OlafConijnConsulting.TestLanguage">
<
Properties
>
<
DomainProperty Id="e3b46693-7a2b-4d03-9c15-7a30f437fd91" Description="Description for OlafConijnConsulting.TestLanguage.ExampleElement.Name" Name="Name" DisplayName="Name" DefaultValue="" IsElementName="true"
>
<
Type
>
<
ExternalTypeMoniker Name="/System/String"
/>
</
Type
>
</
DomainProperty
>
</
Properties
>
</
DomainClass
>

The dsl version I use is: 2006.07


Thanks in advance!

OlafC

Olaf, have you found a solution to your problem? If not, please let me know.

Thanks

Kirill

Kirill Osenkov
unfortanely no. I am hoping this is solved by the next CTP/RC version --which should come out any time soon, I believe
OlafC

Yes - this is solved by DSL tools version 1

OlafC
reply 6

You can use google to search for other answers

 

More Articles

How to know if OnShapeInserted was initiated by a loading process...
Inheritance Restriction?
Where can i get more documents of DLS Tools for developer?
connectors between elements of a compartment
missing menu options in visual studio
Domain Model Definition Schema
Question on using the domain model designer
Show more than one Property in a Compartment
How to remove non application menu-items from the context menu
How to intercept click on icon decorator
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Programmatically creating diagrams
Template Fix: Text templating fails with…
Getting Validation State
Reading and writing models in June relea…
Defining custom multiplicities
unable to find common parent for view fi…
Validation / Rejecting a change from a C…
How to make Tree's?
Stability of Modeling API
Customize DirectiveProcessor
DSL Support For Reverse Engineering, Obj…
Clarifying terms
How to generate Hashtable like collection?
Overriding custom attribute in a derived…
Are there any Community Projects using t…

Hot Articles

academic distribution of a DSL
CompartmentShapes Walkthrough causes Ove…
Tool support for designer definition?
Package Load Failure
Generating Code From a Model Walkthrough
VS Host Assembly Resolving and parameter…
Non string name domain properties
Problem creating a DSL project
DSL and visual studio
How can i force the placement of a port …
How To Navigate over Links
Duplicate AddRule classes in ViewFixupRu…
Question on property generator
How do I get a new ModelElement's corres…
tutorial

Recommend Articles

No 'add new...' on Compartment
DSL Tools November CTP now available
Show more than one Property in a Compart…
protected internal
Catch On Properties Change Event
Custom Command improvements
Custom Modeler Code
How it the class mentioned in directivep…
Can I Generate Code with CodeDom in the …
Dynamically determining link type
Localization
How to generate additional property for …
Template transformation error in designe…
Template Fix: Text templating fails with…
toolbox problem - reset toolbox doesn't …