<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi Sumit,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Attributes in Udm have the following type():<o:p></o:p></p><p class=MsoNormal>String, Boolean, Integer, Real, or Text (Text is the same thing as String)<o:p></o:p></p><p class=MsoNormal>Attributes may be arrays:<o:p></o:p></p><p class=MsoNormal>bool attrArray = ((meta.max() != 0) && (meta.max() != 1));<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>UmlExt.h declares the following functions, which I think address your other questions <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>UDM_DLL set<Attribute> AncestorAttributes(const Class &c)<o:p></o:p></p><p class=MsoNormal>{<o:p></o:p></p><p class=MsoNormal> set<Attribute> attributes;<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> set<Class> ancestors = AncestorClasses(c);<o:p></o:p></p><p class=MsoNormal> set<Class>::iterator i = ancestors.begin();<o:p></o:p></p><p class=MsoNormal> while( i != ancestors.end() )<o:p></o:p></p><p class=MsoNormal> {<o:p></o:p></p><p class=MsoNormal> set<Attribute> a = i->attributes();<o:p></o:p></p><p class=MsoNormal> attributes.insert(a.begin(), a.end());<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> ++i;<o:p></o:p></p><p class=MsoNormal> }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> return attributes;<o:p></o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>UDM_DLL set<Class> AncestorClasses(const Class &c)<o:p></o:p></p><p class=MsoNormal>{<o:p></o:p></p><p class=MsoNormal> set<Class> ret;<o:p></o:p></p><p class=MsoNormal> ret.insert(c);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> set<Class> baseTypes = c.baseTypes();<o:p></o:p></p><p class=MsoNormal> set<Class>::iterator i = baseTypes.begin();<o:p></o:p></p><p class=MsoNormal> while( i != baseTypes.end() )<o:p></o:p></p><p class=MsoNormal> {<o:p></o:p></p><p class=MsoNormal> set<Class> a = AncestorClasses(*i);<o:p></o:p></p><p class=MsoNormal> ret.insert(a.begin(), a.end());<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> ++i;<o:p></o:p></p><p class=MsoNormal> }<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> return ret;<o:p></o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Kevin<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> gme-users-bounces@list.isis.vanderbilt.edu [mailto:gme-users-bounces@list.isis.vanderbilt.edu] <b>On Behalf Of </b>Ray, Sumit (US SSA)<br><b>Sent:</b> Thursday, March 08, 2012 6:38 PM<br><b>To:</b> gme-users<br><b>Cc:</b> Ray, Sumit (US SSA)<br><b>Subject:</b> [gme-users] attribute extraction using the UDM back end<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hi,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m trying to access all of the attributes associated with a <model> object as well as the types of the attributes using the UDM backend. In tracing through the backend, I find that both of these methods in Udm::Object only provide attributes described locally in the <model> class. <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> set<Uml::Attribute> nodeAttr = [Udm::Object instance].type().Attribute_kind_children();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> set<Uml::Attribute> nodeAttr = [Udm::Object instance].type().attributes();<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In particular, these methods do not provide the inherited attributes. I did not see a method that allows programmatically traversing up the meta-model inheritance hierarchy. Of course I can cast to the parent object and then access the attributes, but I am looking for an approach that is more reflective and allows discovery of the hierarchy at runtime rather than requiring static knowledge of the hierarchy.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Also, the above “attribute retrieval” methods do not provide “type” information. Is there an interface to get the type of an attribute or is the recommended approach just calling the type specific attribute accessor methods?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any suggestions would be useful.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks, <o:p></o:p></p><p class=MsoNormal>Sumit<o:p></o:p></p></div></body></html>