Enterprise Architect: MDA transformation to XSD breaks enumeration attributes -
i try customize transformation xsd psm. 1 of customizations contains usage of xsdattributes source attributes. works quite fine have single insistent problem regarding enumerations. pim contains uml enumerations , xsdsimpletypes transformed correctly psm. when pim contains class attribute such enum attribute type transformation seems work fine looks attribute type in psm not connected generated enum. causes subsequent generation of xsd schema throw warning "warning no xsd type found for: 'color'. default is: xs:string". if manually select enumeration "color" manually in psm schema generation passes without warnings. simpletypes have no problems , works well.
the relevant part of attribute transformation is
attribute { [...] name=%qt%$attname%qt% scope="public" type=%qt%%atttype%%qt% stereotype="xsdattribute"
the relevant part of class transformation is
%if elemtype == "class"% class %else% enumeration %endif% { name=%qt%%classname%%qt%
the relevant part of intermediary file is:
class { name="apple" stereotype="xsdcomplextype" [...] attribute { [...] name="color" scope="public" type="color" stereotype="xsdattribute" [...] } } enumeration { [...] name="color" stereotype="enumeration" [...] }
can tell me messed transformation?
regards, stefan
i had similar problem. think basic xsd mda template broken since introduced enumeration metatype no longer stereotype on metatype class.
here's did fix it:
class template:
%if elemtype != "class" , elemtype != "enumeration" , elemtype != "datatype"% %endtemplate% class { name=%qt%%classname%%qt% %if classstereotype=="enumeration" or elemtype == "enumeration"% stereotype="enumeration" %elseif elemtype == "datatype"% stereotype="xsdsimpletype" %else% stereotype="xsdcomplextype" %endif% notes=%qt%%qt% %transform_current("name","stereotype","notes")% %transform_reference("xsdclass")% %list="attribute" @separator="\n" @indent=" "% } %list="connector" @separator="\n" @indent=" "%
attribute template:
attribute { %transform_reference()% %transform_current("scope","type","notes")% scope="public" type=%qt%%atttype%%qt% notes=%qt%%qt% %if attlowerbound!=""% tag { name="minoccurs" value=%qt%%attlowerbound=="*" ? "unbounded" : value%%qt% } %endif% %if attupperbound!=""% tag { name="maxoccurs" value=%qt%%attupperbound=="*" ? "unbounded" : value%%qt% } %endif% }
Comments
Post a Comment