index > Visual Studio Team System - Domain-Specific Language Tools > RelationShip ZeroOne-ZeroMany as property

RelationShip ZeroOne-ZeroMany as property


Hello,

I was using DSLTools from May VS SDK and it was possible to create relationship 0..1/0..* without graphical representation and edit this as property (of type targetDomainClass) on sourceDomainClass.

but, when i'am using July (and also June) VSSDK, i cannot find a way to do this.

It can be seen on FlowModel example, (FlowElement has Actor property), but in this example relationship is too complicated (is computed when element is dropped on swimlane, etc.)

I created new project from Minimal Language template,
deleted ExampleElement-ExampleElement relationship, commandbuilder
I created new DomainClass1, GeometryShape, ShapeMap between it

now I created Reference relationship ExampleElement[0..1]-DomainClass1[0..*]

...and now I supposed, there will be property "DomainClass1" on ExampleElement to set relationship, but ...is'nt

what i am doing wrong ? what to do next ?

thank you, J.S.

Jan Stuchl?k

I just tried the Minimal Language scenario you described and a property "DomainClass1" is generated on ExampleElement. Try to check the following to see if it helps:

1) When you create the relationship, you see one orange box representing the relationship on the diagram, with two lines connecting to the source and target role-players. Click on the line that goes to the source role-player ExampleElement, in Properties Grid (press F4 to bring it up), make sure "IsPropertyGenerator" is set to true. If that's set to false, the property "DomainClass1" will not be generated.

2) In the same place in Property Grid, check the PropertyName. That's the name used to generate the property. By default, it's the name of the opposite role-player, so "DomainClass1" in this case; but it can be set to something else.

3) Make sure you generate code after making the changes to the model.

Other than that, I can't think of a reason why the property is not generated for now. Thanks!




Frank Fan [MSFT]
Jing Fan

Thank you for your reply, I use these steps you described - and this works without problem.
ExampleElement has property generated of type DomainClass1 named DomainClass1.

But my problem (and i am sorry, that i did not write it clearly) is that this property doesn'n appear in my Designer in PropertyGrid of class ExampleElement, when running "Debugging" project and using this model in VS2005.

When looking at another example - FlowModel, this is working - on FlowElement there is an Actor property and is set by swimlanes, but also can be set from PropertyGrid of any FlowElement. But i did not mentioned the difference...

thank you for any more help with this

Jan Stuchl?k

Hello again,

I do some investigation and solve my problem - My Target class doesn't have domainproperty with ElementName=true.

when i set it, everything works fine.

It can be idea for new validation when saving DomainModel ;)

J.S.

Jan Stuchl?k

There's a bug in the released CTP, where the visibility of the property in properties grid is controlled by the IsBrowsable on the *opposite* role. So for a relationship ARefsB, when you select an instance A, the properties grid shows "B" only if B role has IsBrowsable true.

We have fixed this problem in the next release, so now the visibility of property "B" on A role is controlled by IsBrowsable on A role; and we renamed IsBrowsable to IsPropertyBrowsable to make this clear. So in the next release, to see "B" when A is selected, you need to set IsPropertyBrowsable to true on A role. Thanks!




Frank Fan [MSFT]
Jing Fan
reply 5

You can use google to search for other answers

 

More Articles

Have problem for the DSL walk-through steps
Project type
designer definition toolbox item - compartmentTextTool
package load failure in referencing external assembly
Is there any DSL Specifications?
Resources: Domain Specific Language (DSL) Tools for Model-Driven ...
Popup dialog in DSL
Custom type for property
'security error'
How to add a custom rule that listens on "delete" event...
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Dynamically determining link type
Custom connector target (June CTP)
Cannot add DSL diagram into a Web Project
Creating a modelElement at runtime
Re: Have problem for the DSL walk-throug…
Including template content inside method…
DSL using languages
Change a connector's from and to endpoin…
How to Prevent property from being displ…
Beginner question about the use of DSL T…
Reading and writing models in June relea…
Tying domain classes to shape objects
Package Load Failure with /NoVsip
How it the class mentioned in directivep…
A Software Factory Newbie Wants To Under…

Hot Articles

Problem creating a DSL project
Troubleshooting: replicating toolbox items
Programmatically creating diagrams
Transaction.RollBack() Error: Oject refe…
embedding relationship
Validation when dropping an element on t…
DSL Tools for RTM?
Codegen templates selected at build time
DSL Tools May 2005 with VSTS July CTP?
How to find the parent of a relationship…
Package Load Failure - June CTP
DSL Tools V1 Released
DSL interacting with VS project system.
Do all custom properties have GUIDs?
Have problem for the DSL walk-through st…

Recommend Articles

Is there documentation for the T4 engine…
May CTP is available....
my feedback about dsl
Code Generation Samples Other than HTML?…
Serialize reference type class member
CMDS: Missing package guid for commands …
Join the World's Largest Software Factor…
Deployment - I can't find the template
Cannot add DSL diagram into a Web Project
Split (T4) code in more than 1 text temp…
Is DSL development a language driven dev…
How can I order compartments within a sh…
Custom source for connector
Persistence in XML
The definition of Triangle and Rectangle…