<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Dominik,<br>
<br>
I tested this code with the GReAT sample House2Order. I modified the
AttributeMapping /zt_House2Order/MakeOrder1/CreateOrder, and set up
the configuration to use MakeOrder1 instead of MakeOrder3.<br>
<br>
Getting the id-000-style id is easy. Unfortunately, getting the GUID
requires the COM interface.<br>
<br>
// id-000....-style id<br>
std::string gmeId = UdmGme::UdmId2GmeId(PurchaseOrder.uniqueId());<br>
<br>
// GUID<br>
CComPtr<IUnknown> pUnk;<br>
pUnk.Attach(UdmGme::Udm2Gme(PurchaseOrder)); // caveat: Udm2GME
returns NULL if PurchaseOrder is a Udm XML object<br>
CComQIPtr<IMgaFCO> pFCO = pUnk; // caveat: pFCO will be NULL
if PurchaseOrder is a Folder. (You could use IMgaObject instead)<br>
_bstr_t bstrGuid;<br>
pFCO->GetGuidDisp(bstrGuid.GetAddress());<br>
<br>
PurchaseOrder.name() = std::string("PurchaseOrder") +
static_cast<const char*>(bstrGuid) + gmeId;<br>
// caveat: the static_cast uses the current code page. It should
instead be UTF-8, since Udm strings are UTF-8<br>
// PurchaseOrder.name() ==
PurchaseOrder{ec439575-02fa-48e0-a5cd-02e21c1c6ced}id-0065-00000001<br>
<br>
<br>
This code requires 2 include files:<br>
<br>
<?xml version="1.0" encoding="UTF-16"?><br>
<!DOCTYPE clipboard SYSTEM "mga.dtd" [<br>
<!ELEMENT clipboard
(folder|model|atom|reference|set|connection|regnode)*><br>
<!ATTLIST clipboard<br>
acceptingkind CDATA #IMPLIED<br>
paradigmnamehint CDATA #IMPLIED<br>
><br>
]><br>
<clipboard paradigmnamehint="UMLModelTransformer"><br>
<atom id="id-0066-0000003e" kind="UserCodeLibrary"
role="UserCodeLibrary"><br>
<name>UserCodeLibrary</name><br>
<attribute kind="IncludeFiles"><br>
<value>atlbase.h;mga.h</value><br>
</attribute><br>
<attribute kind="IncludePath"><br>
<value>C:\Program Files
(x86)\GME\Interfaces</value><br>
</attribute><br>
</atom><br>
</clipboard><br>
<br>
<br>
Hope this helps.<br>
<br>
Kevin<br>
<br>
<div class="moz-cite-prefix">On 8/21/2014 8:00 AM, Dominik Giel
wrote:<br>
</div>
<blockquote
cite="mid:trinity-f18c6c37-bb06-4c51-8ad7-5ea721a9427d-1408626049669@3capp-gmx-bs60"
type="cite">
<div style="font-family: Verdana;font-size: 12.0px;">
<div>Dear users of GReAT,</div>
<div>today I want you to ask a question about accessing the GUID
and ObjectID of an object, I am currently using in a rule of
my GReAT-Transformation.</div>
<div>I just need to read it and save the information in a
variable, no write-access is needed. I just want to save the
information of the object like it is displayed in GME into a
variable.<br>
Is there a function provided, where I can access the GUID and
ObjectID which I can implement in an attribute mapping to
write this information into a variable?</div>
<div> </div>
<div>I would be pleased, if someone of you could help me out
with this. Thanks in advance for your help.</div>
<div> </div>
<div>Greetings from Germany,</div>
<div>Dominik Giel</div>
<div> </div>
<div>--</div>
<div>Dominik Giel</div>
<div>ILS - Institute of Airborne Systems</div>
<div>University of Stuttgart</div>
<div><a class="moz-txt-link-abbreviated" href="mailto:dominik.giel@gmx.de">dominik.giel@gmx.de</a></div>
<div> </div>
<div> </div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
great-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:great-users@list.isis.vanderbilt.edu">great-users@list.isis.vanderbilt.edu</a>
<a class="moz-txt-link-freetext" href="http://list.isis.vanderbilt.edu/mailman/listinfo/great-users">http://list.isis.vanderbilt.edu/mailman/listinfo/great-users</a>
</pre>
</blockquote>
<br>
</body>
</html>