Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » xmi:id get lost when saving Resource
xmi:id get lost when saving Resource [message #956237] Wed, 24 October 2012 10:43 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 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 #956303 is a reply to message #956237] Wed, 24 October 2012 11:56 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
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 #956360 is a reply to message #956303] Wed, 24 October 2012 12:50 Go to previous messageGo to next message
Jens Bürger is currently offline Jens Bürger
Messages: 9
Registered: October 2012
Junior Member
Am 24.10.2012 13:56, schrieb Ed Willink:
> Hi
>
> You seem to have omitted your question, except from the title.

My question is: what code am I lacking or what am I doing wrong so that
the xmi:id's get lost? :)

> Perhaps you are encountering the lack of xmi:id stability in
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=313951.

I don't think so. In my case, the saved Resource is completely missing
xmi:id's.

Thanks in advance,
Jens
Re: xmi:id get lost when saving Resource [message #956366 is a reply to message #956303] Wed, 24 October 2012 12:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
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 #956408 is a reply to message #956366] Wed, 24 October 2012 13:34 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
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 #956568 is a reply to message #956408] Wed, 24 October 2012 16:14 Go to previous messageGo to next message
Jens Bürger is currently offline Jens Bürger
Messages: 9
Registered: October 2012
Junior Member
Am 24.10.2012 15:34, schrieb Ed Willink:
> 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.

OK,

If I understand the Javadoc
<http://download.eclipse.org/modeling/mdt/uml2/javadoc/4.0.0/org/eclipse/uml2/uml/resources/util/UMLResourcesUtil.html>
right, I need an updated version of my Eclipse's UML2-plugin, because I
have the original one which shipped with Eclipse PDT Indigo.

So I installed the latest version of UML2 SDK (4.0.1).
In the the feature org.eclipse.uml2 is correctly didsplayed, but after
clicking on "Plug-in Details" the window "Plug-ins contributed by
feature: org.eclipse.uml2" every plug-in displayed is from the outdated
version with build dates from 2011 or 2010.

Did I overlook something?

Thanks in advance,

Jens
Re: xmi:id get lost when saving Resource [message #957330 is a reply to message #956568] Thu, 25 October 2012 06:34 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

2011 dates seem very unlikely. Did you restart after the installation?

Regards

Ed Willink

On 24/10/2012 18:14, Jens Bürger wrote:
> Am 24.10.2012 15:34, schrieb Ed Willink:
>> 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.
>
> OK,
>
> If I understand the Javadoc
> <http://download.eclipse.org/modeling/mdt/uml2/javadoc/4.0.0/org/eclipse/uml2/uml/resources/util/UMLResourcesUtil.html>
>
> right, I need an updated version of my Eclipse's UML2-plugin, because
> I have the original one which shipped with Eclipse PDT Indigo.
>
> So I installed the latest version of UML2 SDK (4.0.1).
> In the the feature org.eclipse.uml2 is correctly didsplayed, but after
> clicking on "Plug-in Details" the window "Plug-ins contributed by
> feature: org.eclipse.uml2" every plug-in displayed is from the
> outdated version with build dates from 2011 or 2010.
>
> Did I overlook something?
>
> Thanks in advance,
>
> Jens
Re: xmi:id get lost when saving Resource [message #957533 is a reply to message #957330] Thu, 25 October 2012 09:38 Go to previous messageGo to next message
Jens Bürger is currently offline Jens Bürger
Messages: 9
Registered: October 2012
Junior Member
Am 25.10.2012 08:34, schrieb Ed Willink:
> Hi
>
> 2011 dates seem very unlikely. Did you restart after the installation?

Yes I did.

I even did something more:

I downloaded eclipse-modeling-indigo-SR2-win32 (instead of the 64-bit
version I currently use) and installed version 4.0.0 of the plugin. the
effect is that *some* of the packages are recognized, but when trying to
create a new plugin-project, the only plugins I can select are
org.eclipse.uml2
org.eclipse.uml2.examples
org.eclipse.uml2.types.source
org.eclipse.uml2.profile.l2.source
org.eclipse.uml2.profile.l3.source


So I am slightly confused now, that even in a "clean install" the
UML2-plugin isn't recognized...

Jens
Re: xmi:id get lost when saving Resource [message #957564 is a reply to message #957533] Thu, 25 October 2012 10:09 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

Well I'm confused too. Why would you expect installing an Indigo package
after installing a Juno package would be good?

I hadn't realised you were not using Juno. Pre-Juno the UML 2.4
complexities do not apply so you may find
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_load_a_UML_.28.uml.29_resource_from_a_standalone_application.3F
helpful.

Regards

Ed Willink




On 25/10/2012 11:38, Jens Bürger wrote:
> Am 25.10.2012 08:34, schrieb Ed Willink:
>> Hi
>>
>> 2011 dates seem very unlikely. Did you restart after the installation?
>
> Yes I did.
>
> I even did something more:
>
> I downloaded eclipse-modeling-indigo-SR2-win32 (instead of the 64-bit
> version I currently use) and installed version 4.0.0 of the plugin.
> the effect is that *some* of the packages are recognized, but when
> trying to create a new plugin-project, the only plugins I can select are
> org.eclipse.uml2
> org.eclipse.uml2.examples
> org.eclipse.uml2.types.source
> org.eclipse.uml2.profile.l2.source
> org.eclipse.uml2.profile.l3.source
>
>
> So I am slightly confused now, that even in a "clean install" the
> UML2-plugin isn't recognized...
>
> Jens
Re: xmi:id get lost when saving Resource [message #959203 is a reply to message #957564] Fri, 26 October 2012 14:27 Go to previous messageGo to next message
Jens Bürger is currently offline Jens Bürger
Messages: 9
Registered: October 2012
Junior Member
Am 25.10.2012 12:09, schrieb Ed Willink:
> Hi
>
> Well I'm confused too. Why would you expect installing an Indigo package
> after installing a Juno package would be good?

I'm sorry - there wasn't any hint for me that the newer packages require
Juno :)
>
> I hadn't realised you were not using Juno. Pre-Juno the UML 2.4
> complexities do not apply so you may find
> http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_load_a_UML_.28.uml.29_resource_from_a_standalone_application.3F
> helpful.

This is helpful and does solve my problem, thanks!

Currently, driven by some reasons, im considering changing my
application from standalone to Eclipse plug-in. That would make some
things easier, right?

Where can I get information how to load the model inside an
Eclipse-environment?

Thanks in advance,

Jens
Re: xmi:id get lost when saving Resource [message #960046 is a reply to message #959203] Sat, 27 October 2012 05:59 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
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
Previous Topic:How to find out that two Interaction Fragment in a Sequence Diagram occur at the same time
Next Topic:loading .uml / .xmi files in eclipse
Goto Forum:
  


Current Time: Sat Sep 20 20:15:05 GMT 2014

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

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