Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Loading XMI fails due to unresolved references that are provided by the LazyLinker when using DSL
Loading XMI fails due to unresolved references that are provided by the LazyLinker when using DSL [message #1722003] Tue, 02 February 2016 08:34 Go to next message
Jason Pell is currently offline Jason PellFriend
Messages: 55
Registered: February 2011
Member
I want to be able to save instances of my DSL to XMI on occasion, especially for network transmission rather than the DSL itself. I have some transient types which are added to instances of the DSL as part of the Lazy Linker process, and thus these work just fine when loading the DSL model.

I have the saving of the XMI model working fine, but the issue occurs when I try to load that XMI instance back, I get a Unresolved reference '//@builtInTypes.0'

Is there a way I can get the Linker process to run for loading XMI resources, or am I completely misunderstanding this whole process.

I have created a sample project which demonstrates the issue.

https://github.com/pellcorp/xtext/

The test case is:
https://github.com/pellcorp/xtext/blob/master/com.pellcorp.mydsl.tests/src/com/pellcorp/mydsl/tests/XmiSerialiserTest.java

[Updated on: Tue, 02 February 2016 08:44]

Report message to a moderator

Re: Loading XMI fails due to unresolved references that are provided by the LazyLinker when using DS [message #1722013 is a reply to message #1722003] Tue, 02 February 2016 09:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14062
Registered: July 2009
Senior Member
you dont move the builtin types to the xmi resource. why not? if they are not in a resource, not even an artifical one, this wont work.
this is why in the serialized xmi there are xtext links.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Loading XMI fails due to unresolved references that are provided by the LazyLinker when using DS [message #1722014 is a reply to message #1722013] Tue, 02 February 2016 09:13 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14062
Registered: July 2009
Senior Member
even if you make the reference untransient (and adopt transientvalueservice instead)
there is only any as type contained in the hidden list


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Loading XMI fails due to unresolved references that are provided by the LazyLinker when using DS [message #1722041 is a reply to message #1722014] Tue, 02 February 2016 12:19 Go to previous message
Jason Pell is currently offline Jason PellFriend
Messages: 55
Registered: February 2011
Member
This is just an example of the kind of model constructs my company uses in their model, but due to size an IP reasons, I had to create a fairly arbitrary model based on the class Entity modelling examples.

When I tried to do serialisation to XMI with our real model I encountered a problem with the transient types, so extended the entity modelling to include them.

Christian Dietrich wrote on Tue, 02 February 2016 04:08
you dont move the builtin types to the xmi resource. why not? if they are not in a resource, not even an artifical one, this wont work. this is why in the serialized xmi there are xtext links.


I am not well versed in this particular part of EMF, so I did not realise this was required.

Christian Dietrich wrote on Tue, 02 February 2016 04:13
even if you make the reference untransient (and adopt transientvalueservice instead)
there is only any as type contained in the hidden list


Your suggestion worked a treat at least for this simple example. I added a transient value service and changed the post process ext file to set the built in types and hidden types to transient=false

https://github.com/pellcorp/xtext/blob/master/com.pellcorp.mydsl/src/com/pellcorp/mydsl/services/MyDslTransientValueService.java

I was able to serialize to and from XMI just fine

Thank you

[Updated on: Tue, 02 February 2016 12:26]

Report message to a moderator

Previous Topic:Deafult value for enums
Next Topic:Changing name of default projects
Goto Forum:
  


Current Time: Tue Sep 21 21:24:45 GMT 2021

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

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

Back to the top