Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » xmi:id get lost when saving Resource
xmi:id get lost when saving Resource [message #949729] Fri, 19 October 2012 08:24 Go to next message
Jens Bürger is currently offline Jens Bürger
Messages: 9
Registered: October 2012
Junior Member
Hello everyone,

I am using the EMF project 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);} 


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 option.

Any ideas?

Thanks in advance,
Jens
Re: xmi:id get lost when saving Resource [message #950040 is a reply to message #949729] Fri, 19 October 2012 15:16 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26137
Registered: July 2009
Senior Member
Jens,

Comments below.

On 19/10/2012 2:31 PM, 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"));
It's generally best to ensure you use an absolute path.
> resource2.getContents().addAll(graph.getRoots());
> try {
> resource2.save(options);}
> What I miss in the saved model are all xmi:id-attributes.
Is this running stand alone in an Eclipse application? What resource
implementation is resource2? I.e., is it's UML2's specialized resource
implementation?
>
> I already had a look at further options in XMIResource but didn't find
> an matching option.
>
> Any ideas?
>
> Thanks in advance,
> Jens
Re: xmi:id get lost when saving Resource [message #953471 is a reply to message #950040] Mon, 22 October 2012 09:15 Go to previous messageGo to next message
Jens Bürger is currently offline Jens Bürger
Messages: 9
Registered: October 2012
Junior Member
Am 19.10.2012 17:16, schrieb Ed Merks:
> Is this running stand alone in an Eclipse application?

I'm not 100% sure what you mean by this. The code is part of an Eclipse
plug-in project. It has a main-method and run via the
"Run As -> Java Application"-command.

> What resource
> implementation is resource2?

It's an implementation of
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
> I.e., is it's UML2's specialized resource
> implementation?

Apparently not :)

Thanks,

Jens
Re: xmi:id get lost when saving Resource [message #953485 is a reply to message #953471] Mon, 22 October 2012 09:27 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26137
Registered: July 2009
Senior Member
Jens,

Comments below.

On 22/10/2012 11:15 AM, Jens Bürger wrote:
> Am 19.10.2012 17:16, schrieb Ed Merks:
>> Is this running stand alone in an Eclipse application?
>
> I'm not 100% sure what you mean by this. The code is part of an
> Eclipse plug-in project. It has a main-method and run via the
> "Run As -> Java Application"-command.
So you're running it stand alone. No plugin.xml registrations will kick in.
>
>> What resource
>> implementation is resource2?
>
> It's an implementation of
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
No, a resource is not a resource set.
>> I.e., is it's UML2's specialized resource
>> implementation?
>
> Apparently not :)
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.
>
> Thanks,
>
> Jens
Previous Topic:Undo operations with EString attributes
Next Topic:[CDO/Hibernate] Export and Import
Goto Forum:
  


Current Time: Thu Oct 23 18:40:30 GMT 2014

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

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