Home » Modeling » UML2 » UUID generation
| | |
Re: UUID generation [message #477762 is a reply to message #477760] |
Sat, 27 September 2008 11:53 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------060909030405090705090604
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Timothy,
Generally you should use eObject.eResource().getURIFragment(eObject).
This will return whatever the resource decides is the URI fragment you
should be using to look up the object within its containing resource.
This might be a fragment path (the default), the intrinsic ID of the
eObject (the value of the eObject.eClass().getEIDAttribute() if it has
one), or the extrinsic ID (the value of XMLResource.getID(eObject) if it
has an associated extrinsic ID). So probably you already have what you
need because UML and GMF typically are making heavy use of extrinsic IDs
that are UUIDs (with your xmi:id comments being indicative of that).
Timothy Marc wrote:
> Ed,
>
> thanks, but where can i configure the uml tool to use this kind of
> implementation. Currently, all elements have only these xmi:id attributes,
> but these couldn't be accessed from within my jet2 transformation via
> EcoreUtil.getID().
>
> Thx
> Timothy
>
> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
> news:gbl4dp$860$1@build.eclipse.org...
>
>> Timothy,
>>
>> You need to use an XMIResourceImpl for which useUUIDs() is specialized to
>> return true. UML and GMF both have resource factories that return such
>> resource implementations already...
>>
>>
>> Timothy Marc wrote:
>>
>>> Hi all,
>>>
>>> i've modeled a simple class diagramm with papyrus and wanted the editor
>>> to
>>> use the useUUID() method from XMIResource (i'm not sure whether this is
>>> the
>>> right class). I need those UUIDs for traceability during a JET2/MTL
>>> M2C-Transformation, ut didn't found any possibility to turn this on.
>>>
>>> Any help would be appreciated.
>>>
>>> Thx
>>> Timothy
>>>
>>>
>>>
>>>
>
>
>
--------------060909030405090705090604
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Timothy,<br>
<br>
Generally you should use eObject.eResource().getURIFragment(eObject).
This will return whatever the resource decides is the URI fragment you
should be using to look up the object within its containing resource.
This might be a fragment path (the default), the intrinsic ID of the
eObject (the value of the eObject.eClass().getEIDAttribute() if it has
one), or the extrinsic ID (the value of XMLResource.getID(eObject) if
it has an associated extrinsic ID). So probably you already have what
you need because UML and GMF typically are making heavy use of
extrinsic IDs that are UUIDs (with your xmi:id comments being
indicative of that).<br>
<br>
<br>
Timothy Marc wrote:
<blockquote cite="mid:gbl5u5$df3$1@build.eclipse.org" type="cite">
<pre wrap="">Ed,
thanks, but where can i configure the uml tool to use this kind of
implementation. Currently, all elements have only these xmi:id attributes,
but these couldn't be accessed from within my jet2 transformation via
EcoreUtil.getID().
Thx
Timothy
"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:Ed.Merks@gmail.com"><Ed.Merks@gmail.com></a> schrieb im Newsbeitrag
<a class="moz-txt-link-freetext" href="news:gbl4dp$860$1@build.eclipse.org">news:gbl4dp$860$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Timothy,
You need to use an XMIResourceImpl for which useUUIDs() is specialized to
return true. UML and GMF both have resource factories that return such
resource implementations already...
Timothy Marc wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi all,
i've modeled a simple class diagramm with papyrus and wanted the editor
to
use the useUUID() method from XMIResource (i'm not sure whether this is
the
right class). I need those UUIDs for traceability during a JET2/MTL
M2C-Transformation, ut didn't found any possibility to turn this on.
Any help would be appreciated.
Thx
Timothy
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>
--------------060909030405090705090604--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Re: UUID generation [message #626958 is a reply to message #477758] |
Sat, 27 September 2008 11:11 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Timothy,
You need to use an XMIResourceImpl for which useUUIDs() is specialized
to return true. UML and GMF both have resource factories that return
such resource implementations already...
Timothy Marc wrote:
> Hi all,
>
> i've modeled a simple class diagramm with papyrus and wanted the editor to
> use the useUUID() method from XMIResource (i'm not sure whether this is the
> right class). I need those UUIDs for traceability during a JET2/MTL
> M2C-Transformation, ut didn't found any possibility to turn this on.
>
> Any help would be appreciated.
>
> Thx
> Timothy
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Re: UUID generation [message #626960 is a reply to message #477760] |
Sat, 27 September 2008 11:53 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------060909030405090705090604
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Timothy,
Generally you should use eObject.eResource().getURIFragment(eObject).
This will return whatever the resource decides is the URI fragment you
should be using to look up the object within its containing resource.
This might be a fragment path (the default), the intrinsic ID of the
eObject (the value of the eObject.eClass().getEIDAttribute() if it has
one), or the extrinsic ID (the value of XMLResource.getID(eObject) if it
has an associated extrinsic ID). So probably you already have what you
need because UML and GMF typically are making heavy use of extrinsic IDs
that are UUIDs (with your xmi:id comments being indicative of that).
Timothy Marc wrote:
> Ed,
>
> thanks, but where can i configure the uml tool to use this kind of
> implementation. Currently, all elements have only these xmi:id attributes,
> but these couldn't be accessed from within my jet2 transformation via
> EcoreUtil.getID().
>
> Thx
> Timothy
>
> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
> news:gbl4dp$860$1@build.eclipse.org...
>
>> Timothy,
>>
>> You need to use an XMIResourceImpl for which useUUIDs() is specialized to
>> return true. UML and GMF both have resource factories that return such
>> resource implementations already...
>>
>>
>> Timothy Marc wrote:
>>
>>> Hi all,
>>>
>>> i've modeled a simple class diagramm with papyrus and wanted the editor
>>> to
>>> use the useUUID() method from XMIResource (i'm not sure whether this is
>>> the
>>> right class). I need those UUIDs for traceability during a JET2/MTL
>>> M2C-Transformation, ut didn't found any possibility to turn this on.
>>>
>>> Any help would be appreciated.
>>>
>>> Thx
>>> Timothy
>>>
>>>
>>>
>>>
>
>
>
--------------060909030405090705090604
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Timothy,<br>
<br>
Generally you should use eObject.eResource().getURIFragment(eObject).
This will return whatever the resource decides is the URI fragment you
should be using to look up the object within its containing resource.
This might be a fragment path (the default), the intrinsic ID of the
eObject (the value of the eObject.eClass().getEIDAttribute() if it has
one), or the extrinsic ID (the value of XMLResource.getID(eObject) if
it has an associated extrinsic ID). So probably you already have what
you need because UML and GMF typically are making heavy use of
extrinsic IDs that are UUIDs (with your xmi:id comments being
indicative of that).<br>
<br>
<br>
Timothy Marc wrote:
<blockquote cite="mid:gbl5u5$df3$1@build.eclipse.org" type="cite">
<pre wrap="">Ed,
thanks, but where can i configure the uml tool to use this kind of
implementation. Currently, all elements have only these xmi:id attributes,
but these couldn't be accessed from within my jet2 transformation via
EcoreUtil.getID().
Thx
Timothy
"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:Ed.Merks@gmail.com"><Ed.Merks@gmail.com></a> schrieb im Newsbeitrag
<a class="moz-txt-link-freetext" href="news:gbl4dp$860$1@build.eclipse.org">news:gbl4dp$860$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Timothy,
You need to use an XMIResourceImpl for which useUUIDs() is specialized to
return true. UML and GMF both have resource factories that return such
resource implementations already...
Timothy Marc wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi all,
i've modeled a simple class diagramm with papyrus and wanted the editor
to
use the useUUID() method from XMIResource (i'm not sure whether this is
the
right class). I need those UUIDs for traceability during a JET2/MTL
M2C-Transformation, ut didn't found any possibility to turn this on.
Any help would be appreciated.
Thx
Timothy
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>
--------------060909030405090705090604--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Goto Forum:
Current Time: Sat Apr 20 04:02:15 GMT 2024
Powered by FUDForum. Page generated in 0.03746 seconds
|