Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [XCore] Create dynamic instance with XMI ids
[XCore] Create dynamic instance with XMI ids [message #1010990] Mon, 18 February 2013 11:09 Go to next message
David Michonneau is currently offline David Michonneau
Messages: 85
Registered: July 2009
Member
I would like to create an XCore dynamic instance (using the menu Create Dynamic instance... in Xcore model) that is persisted with XMI ids (extrinsic ids to be exact), so that it is possible to read the XMI and find what references point to.

We are building several examples from our xcore models, and whenever the model changes, we need to repair the instances manually: currently it is quite hard to read those instances as all references to items in list are referenced by their position in the list they belong to. Having generated extrinsic ids would help. Is there an option anywhere to enable this (other than generating the editor and customize it)?

Thanks,

David
Re: [XCore] Create dynamic instance with XMI ids [message #1011029 is a reply to message #1010990] Mon, 18 February 2013 12:36 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26010
Registered: July 2009
Senior Member
David,

Comments below.

On 18/02/2013 5:09 PM, David Michonneau wrote:
> I would like to create an XCore dynamic instance (using the menu
> Create Dynamic instance... in Xcore model) that is persisted with XMI
> ids (extrinsic ids to be exact), so that it is possible to read the
> XMI and find what references point to.
The resource that's created by "Create Dynamic Instance" isn't one that
automatically assigns XMI IDs. Who is doing the reading of the XMI? A
human. XMI is not really fit for human consumption...
>
> We are building several examples from our xcore models, and whenever
> the model changes, we need to repair the instances manually: currently
> it is quite hard to read those instances as all references to items in
> list are referenced by their position in the list they belong to.
You could make use of EReference.eKeys if your model is amenable to
that, i.e., if for each containment reference there is a combination of
attributes in the referenced type that uniquely identifies each instance
in that one reference:

class Node
{
String label
contains Node[] foo keys label
}

> Having generated extrinsic ids would help. Is there an option anywhere
> to enable this (other than generating the editor and customize it)?
No, there's no option for choosing that.
>
> Thanks,
>
> David
Previous Topic:[XCore] edit instances with XText editor
Next Topic:[CDO] Support to Postgresql 9.0
Goto Forum:
  


Current Time: Wed Aug 27 09:21:55 EDT 2014

Powered by FUDForum. Page generated in 0.01470 seconds