Book a Demo

Author Topic: XSD generation and reference connectors  (Read 4823 times)

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
XSD generation and reference connectors
« on: March 27, 2009, 11:27:59 pm »
Filed the  following bug:

=============================================
When creating XSD schema files connectors which are defined with a
"Reference"containment instead of "Value" are always treated as a
composite relation.
Expectation is that such a relation is created as a reference tag .
The online help shows the following style to be created:
<xs:element ref="Account"/>
This is not accomplishable without changing tagged values for each
source connector. Instead the full object is always included:
<xs:element name="Account" .../>

Reproduced with build 834 up to 842.


Steps to Reproduce:  

Create a class diagram with classes and aggregations between those.
Set the connector containment of some to "Reference" and some to
"value".
Creating the XSD from those does not make a difference.

===================================

Addendum: It does not matter whether an aggregation. association or composite it used.

Oliver
« Last Edit: March 27, 2009, 11:33:57 pm by ofels »

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Sparx proposal
« Reply #1 on: March 27, 2009, 11:32:56 pm »
For those having a similar issue the following information might be useful:

Quote
The "Containment" field in the "Source Role" and "Target Role" tabs in
the connector Properties dialog does not affect the way XSD is
generated.
To generate an element with a "ref" attribute rather than the "name"
attribute, you need to add a couple of tagged-values.

Follow these steps to generate the "ref" attribute, if you had used the
Aggregation connector :

1. Open the tagged-values window ( menu option : View -> Tagged Values )
2. Select the Aggregation connector in the diagram
3. In the tagged-values window, add the tags under the "Connector
Target" section as shown in Snapshot.png.

Please note that in EA you can create an Aggregation connector using
either the "Aggregation" icon in the "Class" tool-box or using the
"Association" icon ( refer to Snapshot.png ). If you had used an
Association connector to draw the aggregation, then the tagged-values
shown in Snapshot.png should be added to "Connector Source" section.

Tha tagged values in question are:
Code: [Select]
anonymousType=false
anonymousRole=true

This is no solution when creating XSDElement objects as the result of a transformation (Class -> XSDElement) as tagged values get lost in the process.
It is also not a solution for complex models with many of those relations.

Oliver