Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Łukasz Dudek on February 18, 2009, 10:28:44 pm
-
Hi all.
Is there any way to generate association between classes as ref and not as definition of an element with associated class as its type?
I define association like this:
(http://img21.imageshack.us/img21/8073/associationgo5.jpg)
EA generates it as:
<xs:complexType name="PartyContact">
<xs:sequence>
<xs:element name="Contact" type="con:Contact" />
</xs:sequence>
<xs:attribute name="partyContactType" use="optional" type="con:ContactType">
</xs:complexType>
But I would like to have it generated like this:
<xs:complexType name="PartyContact">
<xs:sequence>
<xs:element ref="con:Contact" />
</xs:sequence>
<xs:attribute name="partyContactType" use="optional" type="con:ContactType">
</xs:attribute>
</xs:complexType>
I'm aware, that I can define new field in class PartyContact and mark it as reference, and then EA generates XSD as I want, but I would also like to keep associations in the class diagram.
Namespace con is used in different package.
I would appreciate any help.
-
To generate a 'ref' attribute, open the tagged-values window for the connector and set the following tagged-values in the 'Connector Source' section :
1. Tag = anonymousType
Value = false
2. Tag = anonymousRole
Value = true
-
Great. This works. Thanks a lot.
-
To generate a 'ref' attribute, open the tagged-values window for the connector and set the following tagged-values in the 'Connector Source' section :
1. Tag = anonymousType
Value = false
2. Tag = anonymousRole
Value = true
This does not sound like a serious workaround- imagine hundreds of connections to draw where we would have to set the stereotypes for each of those. OK, UML profiles help here a bit, but as even the online help does not give clues (though greatly showing the ref tag without telling how to accomplish this) it would be a good idea to either adapt the help or introduce a connector property (though it should work with a Reference connector type anyway).
Oliver
Update: When applying a transformation those tagged values are lost. So this is definitely not an option, I am afraid.