xText Builder dependency for namedspace import [message #1017218] |
Mon, 11 March 2013 08:32 |
Nicole Behlen 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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03265 seconds