Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XMI id
XMI id [message #404345] Wed, 11 October 2006 13:12 Go to next message
Arun is currently offline ArunFriend
Messages: 61
Registered: July 2009
Member
Hi All,
I have exported a Model from Artisan Studio 6.1 in to xmi file for
generating code using Eclipse ,open Architectureware oAW ,UML 2.0. In the
Exported xmi File i can find 'id' for each object generated...
I have created a new project in eclipse and imported the xmi file
generated from artisan. But i could not find any information of ids when
opened with ecore properties editor?
Is the xmi 'IDs' included in EMF and is it posible to acess the xmi ids
for code generation purpose.

Example of Generated XMI file From Artisan 6.1
<packagedElement xmi:type="uml:StateMachine"
xmi:id="_5725461e-5a7a-4e02-af50-73945fab42c1" name="myclass">

It would be great if some one could help me out or any suggestions
Thanking All,
Arun
Re: XMI id [message #404353 is a reply to message #404345] Wed, 11 October 2006 23:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33255
Registered: July 2009
Senior Member
Arun,

The xmi:ids are managed by the XMIResourceImpl but the Ecore model
doesn't typically use xmi IDs, so the UML importer does not transfer
over these IDs from the UML model to the Ecore model; besides, these are
likely supposed to be UUIDs and if there were two different objects with
this same ID, they wouldn't be universally unique.


Arun wrote:

> Hi All,
> I have exported a Model from Artisan Studio 6.1 in to xmi file for
> generating code using Eclipse ,open Architectureware oAW ,UML 2.0. In
> the Exported xmi File i can find 'id' for each object generated...
> I have created a new project in eclipse and imported the xmi file
> generated from artisan. But i could not find any information of ids
> when opened with ecore properties editor?
> Is the xmi 'IDs' included in EMF and is it posible to acess the xmi
> ids for code generation purpose.
>
> Example of Generated XMI file From Artisan 6.1
> <packagedElement xmi:type="uml:StateMachine"
> xmi:id="_5725461e-5a7a-4e02-af50-73945fab42c1" name="myclass">
>
> It would be great if some one could help me out or any suggestions
> Thanking All,
> Arun
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XMI id [message #404363 is a reply to message #404353] Thu, 12 October 2006 11:48 Go to previous messageGo to next message
Arun is currently offline ArunFriend
Messages: 61
Registered: July 2009
Member
HI Ed merks,
Thankyou for your Reply As you mentioned i understood that IDs are not
included in Ecore model. I need the UUIDs generated from Artisan For
BackAnimation Simulation Purpose..

My goal is to generate code for a State machine by using an oAw Xpand
Templates.I use Artisan 6.1 As my UML tool, i Export the Model in to xmi
and change the extension in to uml2 . Now i import this uml2 file in to
Eclipse and by using oAW Xpand I generate Code.I Select uml2 AS my
MetaModel..

Now For My Simulation I need this Ids (example State Ids of stateMachine)
in my generated code for Back animation As Artisan uses ids For simulation.

Sample Code:Included For simulation
void myclass::EnterOff(void)
{
/*Simulationsupport:Notification function call for entering state:OFF*/
Myfunction(1,"c7f091ac-75bb-46ee-b9f9-58541295c459",0,NULL);
}

Sample XMi: When i Export my model from Artisan in to xmi (The same Id for
example State OFF) is stored as 'xmi:id' when i open with a Text Editor.

<subvertex xmi:type="uml:State"
xmi:id="_c7f091ac-75bb-46ee-b9f9-58541295c459" name="OFF"
outgoing="_76d0d894-5f1b-47fc-8ec9-ac09ae977cdf"
incoming="_2a85cc4f-22cb-4199-9611-e70f71710ddb
_081af502-e9ac-485d-a616-4e9c5d371305"/>

SO how Can i include this IDS in the Ecore model?
Thanking You
Arun
Re: XMI id [message #404366 is a reply to message #404363] Thu, 12 October 2006 21:42 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33255
Registered: July 2009
Senior Member
Arun,

Maybe I misunderstood your question or still do. Given an EObject x,
you can use x.eResource().getFragment(x) to retrieve the fragment that
will be used to reference that object; this will be the xmi:id if the
object has one. You can use Resource.getEObject(...) to looks up an
object given it's fragment or ID. If the resource is an XMLResource,
you can use XMLResource.getID/setID to get or set the xmi:id itself.


Arun wrote:

> HI Ed merks,
> Thankyou for your Reply As you mentioned i understood that IDs are not
> included in Ecore model. I need the UUIDs generated from Artisan For
> BackAnimation Simulation Purpose..
>
> My goal is to generate code for a State machine by using an oAw Xpand
> Templates.I use Artisan 6.1 As my UML tool, i Export the Model in to
> xmi and change the extension in to uml2 . Now i import this uml2 file
> in to Eclipse and by using oAW Xpand I generate Code.I Select uml2 AS
> my MetaModel..
>
> Now For My Simulation I need this Ids (example State Ids of
> stateMachine) in my generated code for Back animation As Artisan uses
> ids For simulation.
>
> Sample Code:Included For simulation
> void myclass::EnterOff(void)
> {
> /*Simulationsupport:Notification function call for entering state:OFF*/
> Myfunction(1,"c7f091ac-75bb-46ee-b9f9-58541295c459",0,NULL);
> }
>
> Sample XMi: When i Export my model from Artisan in to xmi (The same Id
> for example State OFF) is stored as 'xmi:id' when i open with a Text
> Editor.
>
> <subvertex xmi:type="uml:State"
> xmi:id="_c7f091ac-75bb-46ee-b9f9-58541295c459" name="OFF"
> outgoing="_76d0d894-5f1b-47fc-8ec9-ac09ae977cdf"
> incoming="_2a85cc4f-22cb-4199-9611-e70f71710ddb
> _081af502-e9ac-485d-a616-4e9c5d371305"/>
>
> SO how Can i include this IDS in the Ecore model? Thanking You
> Arun
>
>
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Circular references in ecore models
Next Topic:Is it possible to use a Ecore2XML mapping while loading a model generated from XML Schema?
Goto Forum:
  


Current Time: Thu Nov 21 21:56:35 GMT 2024

Powered by FUDForum. Page generated in 0.04902 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top