xmi:id get lost when saving Resource [message #956237] |
Wed, 24 October 2012 06:43  |
Eclipse User |
|
|
|
Hello everyone,
I am using the EMF project http://www.eclipse.org/modeling/emft/henshin/.
Currently I am using Henshin to do a model transformation on a UML model.
The transformed model is contained in an EGraph and saved like this:
options.put(XMIResource.OPTION_SCHEMA_LOCATION,
Boolean.TRUE); Resource resource2 =
resourceSet.createResource(URI.createFileURI("seclinks_corrected.uml"));
resource2.getContents().addAll(graph.getRoots());
try {
resource2.save(options);}
where
org.eclipse.emf.ecore.resource.impl
is used as ResourceImplementation.
What I miss in the saved model are all xmi:id-attributes.
I already had a look at further options in XMIResource but didn't find
an matching options.
I already asked the EMF-people and Ed Merks suggested:
"So you need to be sure to register the necessary UML2 things. They
have some UMLUtil thingy that you can use to initialize a resource set.
Ask questions about UML2 on eclipse.modeling.mdt.uml2"
So here I am :)
Thanks in advance,
Jens
|
|
|
|
|
|
Re: xmi:id get lost when saving Resource [message #956408 is a reply to message #956366] |
Wed, 24 October 2012 09:34   |
Eclipse User |
|
|
|
Hi
Yes. It seems like a Resource without the useUIds is in use.
Using UMLResourcesUtil.init() is to all intents and purposes mandatory
to get UML registrations correct in a standalone context.
Regards
Ed Willink
On 24/10/2012 14:55, Ed Merks wrote:
> Ed,
>
> It seems likely that he's not registered the UML resource factories
> correctly. There's some UML utility that does that for stand alone
> applications, right?
>
> On 24/10/2012 1:56 PM, Ed Willink wrote:
>> Hi
>>
>> You seem to have omitted your question, except from the title.
>>
>> Perhaps you are encountering the lack of xmi:id stability in
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=313951.
>>
>> Regards
>>
>> Ed Willink
>>
>> On 24/10/2012 12:43, Jens Bürger wrote:
>>> Hello everyone,
>>>
>>> I am using the EMF project
>>> http://www.eclipse.org/modeling/emft/henshin/.
>>> Currently I am using Henshin to do a model transformation on a UML
>>> model.
>>>
>>> The transformed model is contained in an EGraph and saved like this:
>>> options.put(XMIResource.OPTION_SCHEMA_LOCATION,
>>> Boolean.TRUE); Resource resource2 =
>>> resourceSet.createResource(URI.createFileURI("seclinks_corrected.uml"));
>>>
>>> resource2.getContents().addAll(graph.getRoots());
>>> try {
>>> resource2.save(options);}
>>>
>>> where
>>> org.eclipse.emf.ecore.resource.impl
>>> is used as ResourceImplementation.
>>> What I miss in the saved model are all xmi:id-attributes.
>>>
>>> I already had a look at further options in XMIResource but didn't
>>> find an matching options.
>>>
>>> I already asked the EMF-people and Ed Merks suggested:
>>> "So you need to be sure to register the necessary UML2 things. They
>>> have some UMLUtil thingy that you can use to initialize a resource
>>> set. Ask questions about UML2 on eclipse.modeling.mdt.uml2"
>>>
>>> So here I am :)
>>>
>>> Thanks in advance,
>>> Jens
>>
>
|
|
|
|
|
|
|
|
Re: xmi:id get lost when saving Resource [message #960046 is a reply to message #959203] |
Sat, 27 October 2012 01:59  |
Eclipse User |
|
|
|
Hi
>
> Where can I get information how to load the model inside an
> Eclipse-environment?
>
It just works. I really don't understand the question. Perhaps you just
need to follow some basic EMF tutorials.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.05335 seconds