Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Changing outlet path from within Xpand or Xtend
Changing outlet path from within Xpand or Xtend [message #551184] Thu, 05 August 2010 14:23 Go to next message
Jason Barkanic is currently offline Jason Barkanic
Messages: 16
Registered: November 2009
Junior Member
Is there anyway to change the current outlet path from within Xpand or Xtend?

I have a Xpand template that is looping on a top level item, and creating a directory for each entry. I want to call an existing template to generate stuff into that directory. The problem is, the existing template is set up to generate into the root of the outlet.

The root of the outlet in this case is the location I'm creating all the directories. I want to change it to the particular directory I want to populate before I call the existing template.

Other options I can think of:

1.) Change the existing template to accept a 'path' parameter. (Which means modifying everywhere it is currently used)
2.) Some multiple pass system where I invoke one workflow to create all the directories, then fire up a new workflow instance for each of the directories (with the outlet set to the particular directory).

Sorry if I missed something obvious in the documentation.
Re: Changing outlet path from within Xpand or Xtend [message #551187 is a reply to message #551184] Thu, 05 August 2010 14:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6388
Registered: July 2009
Senior Member
Hi,

i guess solution (1) should be chosen in your case since the names / structure of the subdirectories is dynamic.

Regards
Christian
Re: Changing outlet path from within Xpand or Xtend [message #551232 is a reply to message #551187] Thu, 05 August 2010 16:55 Go to previous messageGo to next message
Jason Barkanic is currently offline Jason Barkanic
Messages: 16
Registered: November 2009
Junior Member
I suppose that would be a best practice for re-use when creating Xpand templates? Anytime you are using the FILE statement, have a parameter path segment.

I didn't even think about it when I was creating the template I'm trying to re-use now.
Re: Changing outlet path from within Xpand or Xtend [message #551234 is a reply to message #551232] Thu, 05 August 2010 17:02 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6388
Registered: July 2009
Senior Member
In this case you should rather consider to run a specific generator with an different outlet - maybe using an own workflow component.

or how would you like this dillema to be solved? maybe you have a proposal for a feature reuqest.

~Christian

[Updated on: Thu, 05 August 2010 17:04]

Report message to a moderator

Re: Changing outlet path from within Xpand or Xtend [message #551263 is a reply to message #551234] Thu, 05 August 2010 18:23 Go to previous messageGo to next message
Jason Barkanic is currently offline Jason Barkanic
Messages: 16
Registered: November 2009
Junior Member
Yeah, it feels like I'm doing things in a way that does not exactly fit the tool, but it surprises me that it would be that uncommon.

I guess the problem is that the information in my model covers not only the textual artifacts that will be generate but also the directory structure in which they need to reside. I.e. the directory is a generated from the model.

The outlet system enables some nice syntactic sugar so you don't have to always pass path parameters to FILE statements (setting some context vs. passing parameters), but it doesn't work when that information is coming from a model. I guess the question would be 'should' it, either by the ability to access and set the context, or some other new way.

Would it be worth it to submit a request for that kind of thing?
Re: Changing outlet path from within Xpand or Xtend [message #551281 is a reply to message #551263] Thu, 05 August 2010 19:19 Go to previous message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6388
Registered: July 2009
Senior Member
Hi,

i don't know if this usecase is that common to have this as a feature. i guess a common solution would be:

(1) run a workflow that generates a configured workflow (with an generator call / configured outlet foreach model part)
(2) run the second workflow

Regards
Christian
Previous Topic:Type resolution issue (Xtend)
Next Topic:[Acceleo][EMTL] Very strange behaviour of the builder
Goto Forum:
  


Current Time: Sat Oct 25 12:10:21 GMT 2014

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

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