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>


[3034 byte] By [OlafC] at [2007-12-24]
# 1

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

AlanCameronWills at 2007-10-8 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 2

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 at 2007-10-8 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 3

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

Thanks

Kirill

KirillOsenkov at 2007-10-8 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 4
unfortanely no. I am hoping this is solved by the next CTP/RC version --which should come out any time soon, I believe
OlafC at 2007-10-8 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 5

Yes - this is solved by DSL tools version 1

OlafC at 2007-10-8 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...

Visual Studio

Site Classified