Type maps for xsd to uml

General discussions about code engineering

Moderator: Moderators

Type maps for xsd to uml

Postby jschardt@phlyins.com » Mon Mar 21, 2011 2:17 pm

I am using the XML to UML transform in MagicDraw 16.9. It does a fair job creating classes as expected. But some types do not seem to get transformed.

For example: I have an XSD class M that is stereotyped
Code: Select all
<<xsdcomplextype>>
and
Code: Select all
<<xsdsequence>>
. This class has an attribute AT1 with stereotype
Code: Select all
<<xsdelement>>
. The attribute AT1 has Type
Code: Select all
string [XML Schema Profile::http://www.w3.org/2001/XMLSchema]
.

The UML to XML Schema Type Map has a map from this string type to the UML String type. But when I perform the XML to UML transformation (reversing the type mapping) the attribute AT1 has no type associated with it in UML Class M. Why not?

Thanks,
Jim
jschardt@phlyins.com
Forum Newbie
Forum Newbie
 
Posts: 6
Posts Rating:0
Joined: Thu Mar 10, 2011 9:34 am

Re: Type maps for xsd to uml

Postby jschardt@phlyins.com » Tue Mar 22, 2011 12:49 pm

FYI, I have tried a lot of experimentation with the XML to UML transformation. While the transform will:
* Take an XSD class and transform it into a UML class
* Copy the name of each attribute in the XSD class and transform it into attributes on the UML class
* Copy the XSD classes' attribute type if the attribute type is another XSD class into types on the UML classes' attributes

The transform will not transform primitive types. For example if there is an attribute, <<XSDElement>> myAttribute : string Then the resulting UML class after the transform will have an attributed called myAttribute with no type information. The string datatype did not get transformed to the String UML data type.

Practically speaking this means that when reverse engineering an XSD file into a set of UML classes, the modeler must go into every attribute in each UML class and add the datatype to the attribute -- usually a UML String, Date, Boolean, or Integer type.

Cheers,
Jim
jschardt@phlyins.com
Forum Newbie
Forum Newbie
 
Posts: 6
Posts Rating:0
Joined: Thu Mar 10, 2011 9:34 am

Re: Type maps for xsd to uml

Postby TomasJkn » Wed Mar 23, 2011 10:18 am

Hello Jim,

This seems to be a bug. From the description of the situation, you are doing everything right - so it should work, but it does not.
And I've also tried this out, and it does not work for me also :|.

I will perform more investigation on this tomorrow (dev team has already left today), and if I get a confirmation, we will register it, and will also try to find/suggest some workaround for you.

Sincerely
Tomas Juknevicius
Senior Systems Analyst
No Magic Europe
TomasJkn
Customer Support
Customer Support
 
Posts: 63
Posts Rating:6
Joined: Mon May 10, 2010 9:24 am


Return to Code engineering

Who is online

Users browsing this forum: No registered users and 1 guest