|
Re: [XCore] Create dynamic instance with XMI ids [message #1011029 is a reply to message #1010990] |
Mon, 18 February 2013 17:36 |
Ed Merks Messages: 33141 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
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02863 seconds