Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » xText Builder dependency for namedspace import
xText Builder dependency for namedspace import [message #1017218] Mon, 11 March 2013 08:32 Go to next message
Nicole BehlenFriend
Messages: 8
Registered: May 2012
Location: Madrid
Junior Member
Hello,

I have a question regarding how to handle saving two models with crossreferences using the importedNamespace-mechanism.

We have to two dsl models:

Languages:
(contains a list of available languages).
Feature:
(Feature has references to the available languages)

The model works fine with the xText Editors.

We have also a customized EMF-Editor.
The Languages Model and the Feature Models (could be several) are added to the resource set. On doSave is where I get in trouble, if I add a new Language to the languages model and refer from a Feature to it.

The following Exception is thrown:
org.eclipse.xtext.parsetree.reconstr.XtextSerializationException:
Could not serialize cross reference from
Feature'version_a'.textDescriptions[0]->LanguageText.textList[2]->
TextToken.language to Languages.languages[2]->Language'Spanish'

After a lot of debugs, it seems to be related with the xText Builder.
Calling the save of all resources in the same workspacemodifyjob it always fails, although the language resource is saved first. I guess because the builder is called after the job has finished.

I created two workspacemodifyjobs. The first to store the languages model and the second to store the features. Now its a 50% chance. Sometimes the new language could be resolved, sometimes not. This seems to depend if the builder job has finished before the save resource or not.

The only way to get it working, is to join the build by
Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null).

I am using xText 2.2.1. Is there better way to fix it?

Thanks

[Updated on: Mon, 11 March 2013 19:04]

Report message to a moderator

Re: xText Builder dependency for namedspace import [message #1017265 is a reply to message #1017218] Mon, 11 March 2013 11:25 Go to previous messageGo to next message
Nicole BehlenFriend
Messages: 8
Registered: May 2012
Location: Madrid
Junior Member
Ok, I will simplify my question:
Can you please confirm that cross references with the importedNamespace-mechansim needs the xText builder?

If so, what would be the correct way to serialize both models, so that the cross references could be resolved correctly?

[Updated on: Mon, 11 March 2013 11:27]

Report message to a moderator

Re: xText Builder dependency for namedspace import [message #1017651 is a reply to message #1017265] Tue, 12 March 2013 09:10 Go to previous message
Nicole BehlenFriend
Messages: 8
Registered: May 2012
Location: Madrid
Junior Member
Hi again, I am still investigating. I found the DirtyStateManager. Could this be an alternative solution?
Previous Topic:Validating Manually
Next Topic:Xtext import problem
Goto Forum:
  


Current Time: Thu Apr 25 15:05:22 GMT 2024

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

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

Back to the top