Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Acceleo 3 standalone with traceability
Acceleo 3 standalone with traceability [message #1841248] Fri, 07 May 2021 19:03 Go to next message
Elie Richa is currently offline Elie RichaFriend
Messages: 72
Registered: February 2016
Member
Hello folks,

I'm looking to gather traceability information linking my Acceleo templates to the generated files and vice versa.

I saw advice here about using AcceleoPreferences.switchTraceability(boolean) to activate tracing, but that doesn't seem to work in standalone mode.

Is there an alternate way to activate tracing in standalone mode?

I also tried using the Acceleo Application run configuration both with Runner "Java Application" and "Acceleo Plug-in Application". The former ran but didn't produce the traceability model. The latter did not start at all.

Even though my main use is standalone, a solution in the Eclipse plug-in mode would be acceptable.

Any ideas how/if I could do that?

Thanks!


Elie Richa, Ph.D
Software Engineer, AdaCore
https://www.adacore.com
Re: Acceleo 3 standalone with traceability [message #1841254 is a reply to message #1841248] Sat, 08 May 2021 04:55 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The "Acceleo Plug-in Application" has been broken for very many years. I thought that it had now been retracted as a menu option. Are you sure you are using a recent release? There has been a maintenance release at least every year.

I have never used the traceability, so I can only recommend that if you have some environment in which it works, you use the debugger to contrast how the interesting functionality starts in working / not-working contexts. Else follow AcceleoPreferences.switchTraceability(boolean) though to what it sets and then search for what reads that setting / has "trace" in its class / method names. In particular search the JUnit tests for something that animates traceability.

Since Acceleo execution is pretty much a standalone invocation anyway, I see no reason why it shouldn't work.

Regards

Ed Willink
Re: Acceleo 3 standalone with traceability [message #1841562 is a reply to message #1841254] Thu, 20 May 2021 15:49 Go to previous message
Elie Richa is currently offline Elie RichaFriend
Messages: 72
Registered: February 2016
Member
Hello,

Thanks Ed for your suggestions. I was using Eclipse 2020-12 and Acceleo 3.7.11.202102190929. So it's a fairly recent release and I still saw remnants of the Acceleo Plug-in Application.

In the end I went on a different route which seems promising. I registered an IAcceleoTextGenerationListener and implemented the textGenerated(AcceleoTextGenerationEvent arg0) event. That seems to be called at every text emission, and it receives the Acceleo Block object that is emitting the text (ForBlock, IfBlock etc...). The Block object is in an EMTL resource with a URI that can help me get to the original MTL file, and it contains start/end character offsets in the original MTL file.

With all this data I believe I should be able to construct a traceability file that links each generated text substring to the MTL location that created it.


Elie Richa, Ph.D
Software Engineer, AdaCore
https://www.adacore.com
Previous Topic:[Xtend] M2T transformation examples
Next Topic:Acceleo within Sirius
Goto Forum:
  


Current Time: Fri Apr 26 10:32:03 GMT 2024

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

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

Back to the top