XMI id [message #404345] |
Wed, 11 October 2006 09:12  |
Eclipse User |
|
|
|
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 #404366 is a reply to message #404363] |
Thu, 12 October 2006 17:42  |
Eclipse User |
|
|
|
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
>
>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04226 seconds