Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [MWE2] Help executing mwe2 workflows from java (Error in executing mwe2 workflows from java)
[MWE2] Help executing mwe2 workflows from java [message #668552] Fri, 06 May 2011 08:21 Go to next message
Marie-Pierre Oudot is currently offline Marie-Pierre OudotFriend
Messages: 3
Registered: May 2011
Junior Member
We have 2 MWE2 files.
Thanks to an XpandComponent, the first one generates an Xtend file inside the Eclipse project.

The second MWE2 file uses the previously generated Xtend file to transform a model.

If we execute the 2 MWE2 workflows in Eclipse, it works.
Now, we try to write a Java code to call the 2 MWE2 files sequentially.

Injector injector = new Mwe2StandaloneSetup().createInjectorAndDoEMFRegistration();
Mwe2Runner mr = injector.getInstance(Mwe2Runner.class);
mr.run("mwe_1",params);
mr.run("mwe_2",params);


We have the following error : the second MWE2 workflow doesn't find the generated Xtend file. It seems like a refresh problem ?

Exception in thread "main" java.lang.RuntimeException: Problems running workflow :
[ERROR]: Property 'invoke' not specified properly. AbstractExtension file 'gen::foo' not found.


Thanks for help
Re: [MWE2] Help executing mwe2 workflows from java [message #668556 is a reply to message #668552] Fri, 06 May 2011 08:36 Go to previous message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

it is well possible that it is a refresh-problem (you could programmatically refresh the workspace/project) in between the two mwe2-invokations.

That said, don't run mwe files programmatically! Usually (as you post in the TMF forum), some component in the mwe file will call a XYLanguageStandaloneSetup. This will modify global registries (of your running eclipse) in a way, you may not want (usually, the language registered then is already registered etc. so you only destroy your running eclipse).

There are at least ways out of the problem:
-invoke the generation programmatically (directly using the XpandComponent)
--i.e. re-program what the mwe would do when running standalone (except for the negative side effects)
-make the reader component conditional (use it for standalone invokation, don't use it for programmatic invokation, in which case you run the mwe file with the model slots already filled programmatically)

Alex
Previous Topic:Code repository of DSLs developed with Xtext
Next Topic:Strange selection in editor when selecting something in outline
Goto Forum:
  


Current Time: Mon Sep 23 16:25:40 GMT 2024

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

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

Back to the top